java - Why does Maven choose version 1.0.b2 over 1.3.03 -
I have a project with dependency on the HTTP Builder, it gives me a dependency dependency tree:
[INFO] + - org.codehaus.groovy.modules.http- Builder: http-Builder: Jar: 0.5.1: Compiled [INFO] | + - org.apache.httpcomponents: httpclient: jar: 4.3.2: compiled [INFO] | | \ - Commons-Codec: Commons-Codec: Jar: 1.6: Compiled [INFO] | + - net.sf.json-lib: json-lib: jar: jdk15: 2.3: compiled [INFO] | | + - Commons-Binutillas: Commons-Binutils: Jar: 1.8.0: Compiled [INFO] | | + - Commons-collection: Commons Collection: Jar: 3.2.1: Compiled [INFO] | | + - Commons-Lang: Commons-Lang: Jar: 2.4: Compiled [INFO] | | \ - net.sf.ezmorph: ezmorph: jar: 1.0.6: compilation [INFO] | + - net.sourceforge.nekohtml: nekohtml: jar: 1.9.9: compiled [INFO] | | \ - Excerpts: Xiris Implex: Jar: 2.8.1: Compile [INFO] | | \ - xml-apis: xml-apis: jar: 1.3.03: compiled [INFO] | After adding the hibernate-unit manager, xml-apis: aml-apis - Version change of Suddenly, Maven likes to use version 1.0b2 which has a sensory dependency via dom4j:
[INFO] + - org.hibernate: hibernate-unit manager: jar: 4.3. 1.final: compilation [INFO] | + - org.jboss.logging: jboss-logging: jar: 3.1.3.ga: compilation [INFO] | + - org.jboss.logging: jboss-logging-annotations: jar: 1.2.0.beta1: compilation [INFO] | + - org.hibernate: Hibernate-Core: Jar: 4.3.1.Finnal: Compilation [INFO] | | + - Anthler: NLL: Jar: 2.7.7: compiled [INFO] | | \ - org.jboss: jandex: jar: 1.1.0.final: compiled [INFO] | + - dom4j: dom4j: jar: 1.6.1: compiled [INFO] | | Because of this, now I get the following exception during the runtime: > Java.lang.IncompatibleClassChangeError: class org.apache.xerces.parsers.AbstractSAXParser $ LocatorProxy does not apply to the requested interface org.xml.sax.Locator I know that I fix it I can manually add dependency with good version number in my pom.xml, but I wonder why it is needed:
& Lt; Version & gt; 1.3.03 & lt; / Edition & gt; & Lt; / Dependencies & gt; By default, when dependency is found to have the same dependency in the tree, Uses the nearest one in the root. In your case, it means
org.hibernate: hibernate-unit manager: jar: 4.3.1. Origin: compile \ - dom4j: dom4j: jar: 1.6.1: compilation \ - xml-apis: xml-apis: jar: 1.0.b2: compiled vs < Pre> organization Codehaus.groovy.modules.http- Builder: http-builder: jar: 0.5.1: compile \ - net.sourceforge.nekohtml: nekohtml: jar: 1.9.9: compilation \ - xres: xercesImpl: Jar: 2.8.1: compile \ - xml-apis: xml-apis: jar: 1.3.03: compilation or put it in any other way 3 levels deep vs 4 level therefore 1.0.b2 wins To resolve it, either xml-apis Exclude from dependency on hibernate-unit manager / Announced received explicity dependence on xml-apis or (though you it may have to play with a little, Jheris and can be a nightmare to its dependence aligned above-wise).
Comments
Post a Comment