Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-4821

Wrong spring-context version resolved when depending on artifact with dependency management and jersey-spring dependency


    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.2.1
    • Fix Version/s: None
    • Component/s: Dependencies
    • Labels:
    • Environment:
      Ubuntu 10.04 64-bit, jdk6
      Windows 7 64-bit, Cygwin, jdk6
      Windows XP SP3 32-bit, Cygwin, jdk5


      Given two artifacts, A and B:

      • A depends on B and on org.springframework:spring-context:3.0.1.RELEASE
      • B depends on com.sun.jersey.contribs:jersey-spring:1.2 and has a dependency management entry that sets the version for org.springframework:spring-context to 3.0.2.RELEASE
      • com.sun.jersey.contribs:jersey-spring:1.2 depends on org.springframework:spring-context:[2.5.2,3)

      When B is built, maven uses org.springframework:spring-context:jar:3.0.2.RELEASE, as expected.
      When A is built, maven 2 uses org.springframework:spring-context:jar:2.5.6, and maven 3 uses version 2.5.6.SEC02.

      I'm attaching a sample project that demonstrates the bug. There are two poms: dependent and dependee. These correspond to A and B above, respectively. The top-level pom just includes the other two for ease of building. In the real-life situation where I found the problem, the two artifacts are from separate projects. There is no unit test, since I don't even know how I'd write a test for this, but there is a bash script called test.sh that checks for the problem.


          Issue Links



              • Assignee:
                bentmann Benjamin Bentmann
                zzantozz Ryan Stewart
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created: