I applied the presented build.gradle file to my junit4ks project and successfully created the jar as follows:
$ ls -la build/libs
drwxr-xr-x 1 qcq0264 1049089 0 Mar 11 10:08 ./
drwxr-xr-x 1 qcq0264 1049089 0 Mar 13 13:00 ../
-rw-r--r-- 1 qcq0264 1049089 37888 Mar 11 09:45 junit4ks-all.jar
However, I would rather like to make the name of jar appeded with the version number, like
-rw-r--r-- 1 qcq0264 1049089 37888 Mar 11 09:45 junit4ks-all-0.16.0.jar
I would gladly write the version number in the build.gradle like
Writing the version number in build.gradle is a quite common exercise in Gradle I believe.
Adding the version number in the jar name requires modifying the katalonPluginPackage task, I believe. Please consider it.
junit4ks-all.jar and posted it in my Github project’s Releases page. Now anybody can download the jar.
junit4ks-all.jar into the
Drivers directory of my another Katalon project webdriverfactory4ks. I mean, I would use the Keyword classes contained in the
junit4ks-all.jar just as one of the External libraries for Katalon Studio. I used
junit4ks keywords to do unit-test my Groovy classes in the
webdriverfactory4ks project using JUnit4. It just worked successfully.
This means, I could make my Custom Keywords packaged into a jar, publish it via Github, reuse it in another Katalon projects successfully.