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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.2.1
    • None
    • Dependencies
    • None
    • Ubuntu 10.04 64-bit, jdk6
      Windows 7 64-bit, Cygwin, jdk6
      Windows XP SP3 32-bit, Cygwin, jdk5

    Description

      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.

      Attachments

        1. dependency-versions.zip
          2 kB
          Ryan Stewart

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: