You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Benjamin Bentmann (JIRA)" <ji...@codehaus.org> on 2010/05/30 14:40:13 UTC

[jira] Closed: (MNG-4692) Maven choose the wrong transitive dependency

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

Benjamin Bentmann closed MNG-4692.
----------------------------------

    Resolution: Not A Bug
      Assignee: Benjamin Bentmann

As documented in [Introduction to the Dependency Mechanism|http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html], conflict resolution uses a "nearest wins" strategy, not the newest version.

The relevant piece of the dependency tree for adam-services:
{noformat}
[INFO] rcpers:adam-services:jar:2.2-SNAPSHOT
...
[INFO] +- apireg:apireg:jar:2.13.0:compile
[INFO] |  +- org.springframework:spring-core:jar:2.5.5:compile
...
[INFO] +- rcpers:rcpers-core:jar:2.2-SNAPSHOT:compile
[INFO] |  +- org.springframework:spring-aop:jar:2.5.6.SEC01:compile
{noformat}
spring-core is a direct dependency of apireg and rcpers-core and since apireg comes before rcpers-core in the dependency tree, its version of spring-core wins the conflict resolution.

If the default conflict resolution doesn't work you, you can use dependencyManagement inside the adam-services POM to enforce specific versions of transitive dependencies.

> Maven choose the wrong transitive dependency
> --------------------------------------------
>
>                 Key: MNG-4692
>                 URL: http://jira.codehaus.org/browse/MNG-4692
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Inheritance and Interpolation
>    Affects Versions: 2.2.1
>         Environment: Ubuntu Linux, JVM 1.6.0_18 OpenJdk
>            Reporter: Jean-Eric Cuendet
>            Assignee: Benjamin Bentmann
>         Attachments: bugmaven.tar.gz
>
>
> I have a dependency used by 2 sub-projects (spring-core) but with 2 different versions (2.5.5 and 2.5.6.SEC01)
> My project which uses theses 2 sub-projects gets spring-core 2.5.5 instead of the more recent 2.5.6.SEC01
> I attach a test project which illustrates this case.
> To reproduce:
>   1. untar proj.tar.gz
>   2. Run ./build.sh
>   3. Have a look at the xxx-tree.log generated files
> The dep for apireg is 2.5.5 -> OK
> The dep for rcpers-core is 2.5.6.SEC01 -> OK
> The dep for adam-services is 2.5.5 -> NOK (Should be 2.5.6.SEC01 since it depends on rcpers-core)

-- 
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