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

                 Key: MNG-4821
                 URL: http://jira.codehaus.org/browse/MNG-4821
             Project: Maven 2 & 3
          Issue Type: Bug
          Components: Dependencies
    Affects Versions: 2.2.1
         Environment: Ubuntu 10.04 64-bit, jdk6
Windows 7 64-bit, Cygwin, jdk6
Windows XP SP3 32-bit, Cygwin, jdk5
            Reporter: Ryan Stewart
         Attachments: dependency-versions.zip

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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to