I have cloned the Gatling Kotlin demo project, using JDK 17, Kotlin 1.3.31 and Gradle 4.4.1. When I try to run the sample test I receive the error:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
I am using WSL2 with Ubuntu.
Any help would be appreciated.
Many Thanks
Adrian
Hi @aidylewis,
Gradle 4.4.1 was released in december 2017! More than 5 years back! Please upgrade!
We test for compatibility with Gradle > 5.0 (but we are planning to raise this because of dependency compatibilities issues)
Cheers!
Thanks updated Gradle to 7.4.2, set JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64.
However, ~/projects/gatling-gradle-plugin-demo-kotlin$ gradle gatlingRun
Returns
java.util.concurrent.ExecutionException: org.gradle.api.GradleException: Failed to create Jar file /home/aidy/.gradle/caches/jars-9/87491e8cdb0229bafcb7120e23222513/jackson-core-2.15.2.jar.
Many Thanks
Adrian
Mmmh, this one is strange.
But I reproduced it.
It seems that we depend on jackson-core-2.15.2.jar but there is a class that need Java 19.
I will check that and keep you posted.
In the meantime, you can use the gradle wrapper we provide, you can even upgrade to the latest version gradle 8.2:
./gradlew wrapper --gradle-version=8.2
It seems like one of our dependency went to build with one version of gradle that make the whole dependency tree uncertain.
Look for AbstractMethodError in builds running Gradle <7 with plugins built in Gradle 7+ · Issue #18570 · gradle/gradle · GitHub
Thanks for your time and patience and I am glad to have found a bug @sbrevet.
Are you aware of this deprecation warning?
~/projects/gatling-gradle-plugin-demo-kotlin$ ./gradlew wrapper --gradle-version=8.2
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.2/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
Many Thanks
Adrian
I installed Gradle 8.2 through sdkman, I am not sure where the gradlew bash script is installing gradle, but it doesn’t seem to be in my path. However, I am very grateful for your help and all the best.
Yes, we are aware of such warning. This is the reason why I mentioned we are considering to raise the gradle lower version threshold. (Because of incompatibilty between gradle versions).
gradle wrapper (aka ./gradlew) is a script that installs itself in the project directory. (see gradlew, gradle/wrapper and .gradle directories)
So when your working directory is the demo project, you can launch it with:
./gradlew --version
This allows to have a gradle version per project.
More about the wrapper in the official Gradle documentation
https://docs.gradle.org/current/userguide/gradle_wrapper.html
Note: it’s the recommended way to execute gradle by gradle documentation.
Cheers!
The issue with Jackson is actually a bug in gradle. It was fixed in the latest gradle release.
@sbrevet We have to update the wrapper version in our samples.