How to configure jar name of custom plugin generated by katalonPluginPackage task of the katalon gradle-plugin


I am trying to create a custom plugin named HighligtElement. The project is visible on GitHub at GitHub - kazurayam/HighlightingElementByTestObjectInEachAndEveryStep at pluginify. I am working on a git branch named pluginify.

I learned How to develop Custom Keywords Plugins to find how to create the jar file. I wrote a build.gradle file as follows:

plugins {
  id 'java'
  id 'groovy'
  id 'com.github.johnrengelman.shadow' version '5.0.0'
  id "com.katalon.gradle-plugin" version "0.0.7"

repositories {

sourceSets {
  main {
    groovy {
      srcDirs = [ 'Keywords', 'Include/scripts/groovy' ]
      srcDir 'Libs'

shadowJar {
  exclude 'Temp*.class'

katalon {
  dependencyPrefix = "com.katalon"
  minimize = false

I executed the katalonPluginPackage task :

I got a jar file named build/libs/HighlightElementByTestObjectInEachAndEveryStep-all.jar


I do not like the name of the created jar file: HighlightElementByTestObjectInEachAndEveryStep-all.jar

Rather I want to name it as highlightelement-1.0.0.jar

  1. HightlightELementByTestObjectInEachAndEveryStep is the name of project. I want to keep it as is. I want to find out how to give to the jar a name different from the project name.
  2. The suffix -all is meaningless.I want to append a version number: -X.X.X.

I think

It is necessary to modify the Gradle plugin com.katalon.gradle-plugin to mee the above requirements.

1 Like

I did that by adding uploadArchives section, and providing artifactId in build.gradle like this:

uploadArchives {

def versionNo = β€œ$versionNo”
def repoUrl = β€œβ€

repositories {
mavenDeployer {
repository(url: repoUrl) {
authentication(userName: β€œ*******”, password: β€œ********”)
pom.groupId = β€˜β€™
pom.version = versionNo
pom.artifactId = β€˜β€™

Here Im actually uploading the plugin in nexus and changing its name, may be you can do it by follwing something similar

1 Like

In the build.gradle, I can add a task katalonPluginPackageAndRename which depends on the katalonPluginPackage. The katalonPluginPackageAndRename task will rename the build/libs/HighlightElementByTestObjectInEachAndEveryStep-all.jar file to build/libs/highlightelement-1.0.0.jar.

I can do it but do not like to.

I hope the com.katalon.gradle-plugin is made better.


I have found out how to name the jar as highlightelement-xxx.jar rather than HighlightElementByTestObjectInEachAndEveryStep-xxx.jar.

Add settings.gradle file in the project directory, where I write a single line:"highlightelement"


then in the command line I ran

$ gradle katalonPluginPackage

I got

:HighlightingElementByTestObjectInEachAndEveryStep [pluginify]$ ls -la | grep settings
drwxr-xr-x    3 urayamakazuaki  staff     96  6 12 06:11 .settings
drwxr-xr-x    4 urayamakazuaki  staff    128  6 12 06:11 settings
-rw-r--r--    1 urayamakazuaki  staff     36  7  2 06:30 settings.gradle
:HighlightingElementByTestObjectInEachAndEveryStep [pluginify]$ ls -la build/libs
total 32
drwxr-xr-x  3 urayamakazuaki  staff     96  7  2 06:31 .
drwxr-xr-x  7 urayamakazuaki  staff    224  6 12 06:12 ..
-rw-r--r--  1 urayamakazuaki  staff  14301  7  2 06:30 highlightelement-all.jar
:HighlightingElementByTestObjectInEachAndEveryStep [pluginify]$ 

What is the ? See

1 Like

My problem is that I got


when I execute

$ gradle katalonPluginPackage

. I do not like the jar name. I want to make it named as


Finally I have found out how to configure jar name of my custom plugin which is generated by katalonPluginPackage task of the katalon gradle-plugin.

  1. create <projectDir>/settings.gradle file and write a line"highlightelement"
  2. in the <projectDir>/build.gradle file,
    • write version = 'x.x.x', which is to declare the version of my custom plugin
    • wite shadowJar { classifier = null }, which is to remove -all out of the jar name.

I got build.gradle file as this.

and I got a jar file named highlightelement-0.4.jar as I wanted.

Let me add a memo for myself how I found the way to configure jar name.

  1. I read the source code of katalon gradle-plugin . There I found that the katalonPluginPackage task depends on shadowJar task.
  2. I found that the shadowJart task resolves name of the jar. I checked the documentation of Shadow / Configuring Output Name.
  3. The documemtation provides enough information how to configure jar name: specify baseName, version and classifier as I want.
1 Like