Note that there are some explanatory texts on larger screens.

plurals
  1. POMaven packages in the a different version than dependency:tree shows
    primarykey
    data
    text
    <p>I have a dependency structure similar to this:</p> <pre><code>A:compile com.jolbox:bonecp:jar:0.7.1.RELEASE:compile com.google.guava:guava:jar:r06:compile com.google.guava:guava:jar:13.0:compile </code></pre> <p>That is, my project depends on A, which depends on Guava 13.0 and BoneCP (which depends on Guava r06).</p> <p>When I run <code>mvn clean dependency:tree | grep guava</code> I see:</p> <pre><code>[INFO] | | \- com.google.guava:guava:jar:13.0:compile </code></pre> <p>Which, as far as I understand Maven's dependency resolution, is what is supposed to happen.</p> <p>However, when I run <code>mvn clean package</code> and unpack the resulting jar, it seems Guava r06 has been included. In A, I am relying on functionality that is in Guava 13.0 but not r06, so I get a runtime failure (<code>java.lang.NoClassDefFoundError: com/google/common/collect/Table</code>).</p> <p>I am using the shade plugin (1.4) to create the jar with all dependencies included. Here is the result of <code>mvn --version</code> (on our build server, where I am having this problem):</p> <pre><code>Apache Maven 3.0.4 (r1232337; 2012-01-17 08:44:56+0000) Maven home: /opt/apache/apache-maven-3.0.4 Java version: 1.6.0_26, vendor: Sun Microsystems Inc. Java home: /usr/lib/jvm/java-6-sun-1.6.0.26/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "2.6.32-5-amd64", arch: "amd64", family: "unix" </code></pre> <p>On a different machine (my local workstation), the packaged jar contains Guava 13.0 as I expected. The version info on that machine is:</p> <pre><code>/usr/java/default Apache Maven 2.2.1 (rNON-CANONICAL_2011-06-28_14-50_mockbuild; 2011-06-28 10:50:25-0400) Java version: 1.6.0_27 Java home: /usr/java/jdk1.6.0_27/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux" version: "2.6.43.8-1.fc15.x86_64" arch: "amd64" Family: "unix" </code></pre> <p>Did the change from Maven 2.2.1 to 3.0.4 change the dependency resolution strategy? What is going on here?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload