If you are going to try upgrading the cucumber-core-*.jar
, you need to know
- which old built-in jar you need to remove out of the
.classpath
file
- which new version of jars you should copy into the
Drivers
folder
Here I assume you are sure you want the cucumber-core-5.7.0.jar
. Then what else? The cucumber-core-5.7.0.jar
would depend on other cucumber-something-x.x.x.jar so that you need to upgrade them at the same time. Unfortunately Katalon Studio provides no help to diagnose the dependency tree.
I would show you how to retrieve the dependency tree.
First you need to install Gradle into your machine. You need to be able to do the following operation in the command line:
$ gradle -version
------------------------------------------------------------
Gradle x.x.x
------------------------------------------------------------
Change the <projectDir>/build.gradle
file as follows:
ext {
AUTO_IMPORTED_JAR_PREFIX = 'AUTOIMPORTED_'
}
repositories {
mavenCentral()
mavenLocal()
}
configurations {
myconf
}
dependencies {
// https://mvnrepository.com/artifact/io.cucumber/cucumber-core
//myconf group: 'io.cucumber', name: 'cucumber-core', version: '7.2.3'
myconf group: 'io.cucumber', name: 'cucumber-core', version: '5.7.0'
}
task drivers {
doFirst {
delete fileTree("Drivers") {
include("**/" + AUTO_IMPORTED_JAR_PREFIX + "*")
}
}
doLast {
copy { copySpec ->
copySpec
.from(project.getConfigurations().getByName("myconf"))
.into("Drivers")
.include(
"**/cucumber*.jar",
)
.rename({ s ->
AUTO_IMPORTED_JAR_PREFIX + s
})
}
}
}
Then in the command line you want to run the following command:
$ cd <projectDir>
$ gradle dependencies
> Task :dependencies
------------------------------------------------------------
Root project 'KS_upgrading_cucumber_jars'
------------------------------------------------------------
myconf
\--- io.cucumber:cucumber-core:5.7.0
+--- io.cucumber:cucumber-gherkin:5.7.0
| \--- io.cucumber:cucumber-plugin:5.7.0
| \--- org.apiguardian:apiguardian-api:1.1.0
+--- io.cucumber:cucumber-gherkin-vintage:5.7.0
| \--- io.cucumber:cucumber-gherkin:5.7.0 (*)
+--- io.cucumber:tag-expressions:2.0.4
+--- io.cucumber:cucumber-expressions:8.3.1
| \--- org.apiguardian:apiguardian-api:1.1.0
+--- io.cucumber:datatable:3.3.1
| \--- org.apiguardian:apiguardian-api:1.1.0
+--- io.cucumber:cucumber-plugin:5.7.0 (*)
+--- io.cucumber:docstring:5.7.0
| \--- org.apiguardian:apiguardian-api:1.1.0
\--- org.apiguardian:apiguardian-api:1.1.0
(*) - dependencies omitted (listed previously)
As you see Gradle tells you the dependency tree of cucumber-core.0.5.7.jar
.
I found that cucumber5.7.0 depends on org.apiguardian:apiguardian-api
. Is it built-in KS? I am not sure.
You can try
$ gradle drivers
Then you will find several jar files are copied into the Drivers
folder.
$ ls Drivers
AUTOIMPORTED_cucumber-core-5.7.0.jar
AUTOIMPORTED_cucumber-expressions-8.3.1.jar
AUTOIMPORTED_cucumber-gherkin-5.7.0.jar
AUTOIMPORTED_cucumber-gherkin-vintage-5.7.0.jar
AUTOIMPORTED_cucumber-plugin-5.7.0.jar
Now you have got 5 jars in the Drivers
folder.
Finally, you have one more setup task to do. You want to follow the instruction at the doc, you should exclude the built-in 5 jars of old version built-in Katalon Studio.
You want to stop KS once, and restart it so that it acknowledges the newer jars prepared in the Drivers
folder.
Please be warned that it is quite likely that upgrading cucumber-core
causes error. It is quite possible that some code of Katalon Studio depends on the Cucumber API of v3.x, or some code of Katalon Studio does not understand the Cucumber API of v5.x. In that case, you should just give it up.