Different dependecies resolution between gradle 1.12 and gradle 2.1

Hi,

I have this buid.gradle

apply plugin: 'java'
    apply plugin: 'eclipse'
          repositories {
      mavenCentral()
     }
          dependencies {
      compile 'jmimemagic:jmimemagic:0.1.2'
     }

running

gradle dependecies

with 1.12 and 2.1 the output seems the same, for example for compile:

\--- jmimemagic:jmimemagic:0.1.2
         +--- oro:oro:2.0.8
         +--- commons-logging:commons-logging:1.0.4
         +--- log4j:log4j:1.2.8
         +--- xerces:xerces:2.4.0
         |
  \--- xerces:xercesImpl:2.4.0 -> 2.7.1
         +--- xerces:xercesImpl:2.7.1
         +--- xml-apis:xml-apis:2.0.2
         \--- xml-apis:xmlParserAPIs:2.0.2

but I get a different behaviour with

gradle eclipse

, .classpath file and xerces dependency.

With gradle 1.12 only xercesImpl-2.7.1.jar is included

with gradle 2.1 it is included xercesImpl-2.7.1.jar and xerces-2.4.0.jar.

This creates some problems in a project I was working, what is the right behaviour? I think the one from 1.12.

Thanks for the help

Try:

gradle dependencyInsight --dependency xerces:2.4

You should get the result (or something similar to it):

No dependencies matching given input were found in configuration ':compile'

If the dependencyInsight report shows xerces:xerces:2.4.0 then xerces-2.4.0.jar should be pulled in.

We ran into this problem and the report for 1.12 and 2.2.1 showed that xerces-2.4.0.jar should have been included. The fact that 1.12 excluded xerces:2.4 was a side effect that we wanted but it looked like the dependency tree should have been pulling xerces:2.4 in. It seems like in gradle 2 a change was made fixing that incorrect behaviour.

Ultimately, we were missing an exclude on a first-level dependency that was pulling in xerces:2.4. Adding the explicit exclude fixed our build.