# Gradle build error from demo project

**URL:** <https://community.gatling.io/t/gradle-build-error-from-demo-project/8097>\
**Category:** Gatling (Open-Source)\
**Created:** [July 8, 2023, 10:57am UTC](https://community.gatling.io/t/gradle-build-error-from-demo-project/8097 "2023-07-08T10:57:00Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![aidylewis](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@aidylewis](https://community.gatling.io/u/aidylewis)\
**Post date:** [July 8, 2023, 10:57am UTC](https://community.gatling.io/t/gradle-build-error-from-demo-project/8097/1 "2023-07-08T10:57:01Z")

</div>

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:

```auto
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().

```

I am using WSL2 with Ubuntu.

Any help would be appreciated.

Many Thanks

Adrian

---

<div class="post-metadata">

**Author:** ![sbrevet](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/sbrevet/32/830_2.png) [@sbrevet](https://community.gatling.io/u/sbrevet)\
**Post date:** [July 8, 2023, 11:18am UTC](https://community.gatling.io/t/gradle-build-error-from-demo-project/8097/2 "2023-07-08T11:18:15Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![aidylewis](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@aidylewis](https://community.gatling.io/u/aidylewis)\
**Post date:** [July 8, 2023, 4:45pm UTC](https://community.gatling.io/t/gradle-build-error-from-demo-project/8097/3 "2023-07-08T16:45:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sbrevet](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/sbrevet/32/830_2.png) [@sbrevet](https://community.gatling.io/u/sbrevet)\
**Post date:** [July 8, 2023, 5:02pm UTC](https://community.gatling.io/t/gradle-build-error-from-demo-project/8097/4 "2023-07-08T17:02:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sbrevet](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/sbrevet/32/830_2.png) [@sbrevet](https://community.gatling.io/u/sbrevet)\
**Post date:** [July 8, 2023, 6:07pm UTC](https://community.gatling.io/t/gradle-build-error-from-demo-project/8097/5 "2023-07-08T18:07:44Z")

</div>

In the meantime, you can use the gradle wrapper we provide, you can even upgrade to the latest version gradle 8.2:

```console
./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](https://github.com/gradle/gradle/issues/18570)

---

<div class="post-metadata">

**Author:** ![aidylewis](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@aidylewis](https://community.gatling.io/u/aidylewis)\
**Post date:** [July 8, 2023, 10:52pm UTC](https://community.gatling.io/t/gradle-build-error-from-demo-project/8097/6 "2023-07-08T22:52:22Z")

</div>

Thanks for your time and patience and I am glad to have found a bug @sbrevet.

---

<div class="post-metadata">

**Author:** ![aidylewis](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@aidylewis](https://community.gatling.io/u/aidylewis)\
**Post date:** [July 9, 2023, 9:41am UTC](https://community.gatling.io/t/gradle-build-error-from-demo-project/8097/7 "2023-07-09T09:41:10Z")

</div>

> [@sbrevet](#):
>
> `./gradlew wrapper --gradle-version=8.2`

Are you aware of this deprecation warning?

```auto
~/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

---

<div class="post-metadata">

**Author:** ![aidylewis](https://avatars.discourse-cdn.com/v4/letter/a/e9a140/32.png) [@aidylewis](https://community.gatling.io/u/aidylewis)\
**Post date:** [July 9, 2023, 9:54am UTC](https://community.gatling.io/t/gradle-build-error-from-demo-project/8097/8 "2023-07-09T09:54:30Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![sbrevet](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/sbrevet/32/830_2.png) [@sbrevet](https://community.gatling.io/u/sbrevet)\
**Post date:** [July 9, 2023, 10:49am UTC](https://community.gatling.io/t/gradle-build-error-from-demo-project/8097/9 "2023-07-09T10:49:12Z")

</div>

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:

```console
./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](https://docs.gradle.org/current/userguide/gradle_wrapper.html)

Note: it’s the recommended way to execute gradle by gradle documentation.

Cheers!

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [July 13, 2023, 5:55pm UTC](https://community.gatling.io/t/gradle-build-error-from-demo-project/8097/10 "2023-07-13T17:55:07Z")

</div>

The issue with Jackson is actually a bug in gradle. It was fixed in the latest gradle release.

---

<div class="post-metadata">

**Author:** ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)\
**Post date:** [July 13, 2023, 5:55pm UTC](https://community.gatling.io/t/gradle-build-error-from-demo-project/8097/11 "2023-07-13T17:55:54Z")

</div>

@sbrevet We have to update the wrapper version in our samples.

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/b/b148e0742de35c6280726cabf3ecd3de2d320f63.png) [@system](https://community.gatling.io/u/system)\
**Post date:** [August 12, 2023, 5:56pm UTC](https://community.gatling.io/t/gradle-build-error-from-demo-project/8097/12 "2023-08-12T17:56:36Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
