You need to use 2.0.9 and then the order will be consistent. In the past we didn't use linked collections so it was subject to the natural ordering, which changed between 1.5 and 1.6. In 2.0.9, the order as defined in the pom is preserved so you can reorder if you want to tweak the resolution. All other things being equal (depth, scope etc) Maven prefers the version found first.
-----Original Message----- From: Richard Chamberlain [mailto:[EMAIL PROTECTED] Sent: Monday, April 28, 2008 8:59 AM To: Maven Users List Subject: Compiled dependencies are different when using different java versions Hi All, I've got a problem consistently resolving a project transitive dependency when using different java versions. In my project xercesImpl is defined as a transitive dependency for two artefacts: Project +- dependency1 | +- xerces:xercesImpl:jar:2.6.2:compile +- dependency2 | +- xerces:xercesImpl:jar:2.8.1:compile In this situation i'm not sure which version is included in compilation. However what I didn't expect was that if I switch JDK versions between jdk1.5.0 and jdk1.6.0 that what is compiled would be different! Below is the dependency tree when run on the same machine, with the same settings, but with different JAVA_HOME variables set. Java 5 > mvn -version Maven version: 2.0.7 Java version: 1.5.0_08 OS name: "windows xp" version: "5.1" arch: "x86" > mvn dependency:tree ... [INFO] +- jaxen:jaxen:jar:1.1.1:compile ... [INFO] | +- xerces:xercesImpl:jar:2.6.2:compile ... [INFO] \- caplin.datasource:datasource-java:jar:4.4.8:compile Java 6 > mvn -version Maven version: 2.0.7 Java version: 1.6.0 OS name: "windows xp" version: "5.1" arch: "x86" > mvn dependency:tree ... [INFO] +- caplin.datasource:datasource-java:jar:4.4.8:compile [INFO] | \- xerces:xercesImpl:jar:2.8.1:compile ... [INFO] +- jaxen:jaxen:jar:1.1.1:compile ... --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
