gradle1-11 wrapper dependencies conflict with project dependencies

After upgrading to latest 1.11(from 1.5) version we got classpath conflict with gradle wrapper. It seems that gradle wrapper implementation uses httpcore-4.2.2.jar and we are using httpcore-4.2.1.jar. The duplicate jars in same classpath causes the following error: java.lang.NoSuchFieldError: DEF_CONTENT_CHARSET

lsof of process: java

29142 root 184u




1573210 /root/.gradle/caches/modules-2/files-2.1/org.apache.httpcomponents/httpcore/4.2.1/2d503272bf0a8b5f92d64db78b4ba9abbaccc6fd/httpcore-4.2.1.jar java

29142 root 308u




1837564 /root/.gradle/wrapper/dists/gradle-1.11-bin/4h5v8877arc3jhuqbm3osbr7o7/gradle-1.11/lib/httpclient-4.2.2.jar

Where are you using ‘httpcore-4.2.1.jar’? In a build script or Gradle plugin, or in your production or test code?

Hi, I’m using it in my production code(used in integration test that I’m running with gradle)

Gradle’s own dependencies are strictly isolated from any code it compiles or runs. If you see a conflict, then it’s for some other reason. Try something like ‘gradle dependencyInsight --configuration testRuntime --dependency httpcore’ to see which version of httpcore is actually chosen.

thanks I’ll try it. as a side note, downgrading back to 1.5 solved problem


found the problem - gwt-dev.jar entered runtime classpath

can I use something like: subprojects { runtime.exclude group ‘’, module: ‘gwt-dev’ … }

to exclude gwt-dev from runtime for all sub-projects?(multiproject env)

It’s ‘configurations.runtime.exclude’.