[ 
http://jira.codehaus.org/browse/MNG-4821?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Benjamin Bentmann closed MNG-4821.
----------------------------------

    Resolution: Duplicate
      Assignee: Benjamin Bentmann

Thanks for the example projects. When building A, B's dependencyManagement is 
ignored (MNG-3038) such that the dependeny graph for A contains the original 
{{spring-context:[2.5.2,3)}} dependency as given by {{jersey-spring:1.2}}. 
Futhermore, a version range overrules any soft version recommendations like the 
{{3.0.1.RELEASE}} given in A's POM. That's why A ends up with 
{{spring-context:jar:2.5.x}}.

For now, you need to use dependency management in A to enforce the version of 
{{spring-context}} you want.

bq. When A is built, maven 2 uses org.springframework:spring-context:jar:2.5.6, 
and maven 3 uses version 2.5.6.SEC02.
This minor difference is the effect of improved version comparision in Maven 3 
which properly recognizes {{2.5.6}} < {{2.5.6.SEC01}} < {{2.5.6.SEC02}}.

> 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
>            Assignee: Benjamin Bentmann
>         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