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

Benjamin Bentmann updated MNG-4797:
-----------------------------------

    Attachment: MNG-4797.zip

I'm not able to reproduce the issue you describe. Attached is a 
complete/buildable project which shows that the dependency management (from a 
parent, but that shouldn't matter), takes precedence over transitive 
dependencies:
{noformat}
Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.5.0_21
Java home: D:\java\jdk-1.5\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 7" version: "6.1" arch: "x86" Family: "windows"
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'dependency'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - test:test:jar:0.1
[INFO]    task-segment: [dependency:tree]
[INFO] ------------------------------------------------------------------------
[INFO] [dependency:tree {execution: default-cli}]
[INFO] test:test:jar:0.1
[INFO] \- org.apache.maven:maven-model:jar:2.0.6:compile
[INFO]    \- org.codehaus.plexus:plexus-utils:jar:2.0.5:compile (version 
managed from 1.4.1)
{noformat}

So unless you can provide a complete example that allows to reproduce the issue 
and analyze it, we can't help.

> Dependency Management precedence issue over Dependency Mediation for 
> Transitive Dependencies 
> ---------------------------------------------------------------------------------------------
>
>                 Key: MNG-4797
>                 URL: http://jira.codehaus.org/browse/MNG-4797
>             Project: Maven 2 & 3
>          Issue Type: Bug
>          Components: Dependencies
>    Affects Versions: 2.2.1
>            Reporter: Ramiah Balasubramanian
>         Attachments: Dependency-Declaration-of-Child-Pom.xml, 
> Dependency-Management-Extract-of-Parent-Pom.xml, MNG-4797.zip, 
> spring-actionscript-superpom-1.0.pom
>
>
> My usecase mirrors the scenario described through an example in 
> [http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Management],
>  in particular,
> {quote}
> b is defined in B's parent's dependency management section and since 
> dependency management takes precedence over dependency mediation for 
> transitive dependencies, version 1.0 will be selected should it be referenced 
> in a or c's pom. b will also have compile scope.
> {quote}
> However, I am unable to see the above behaviour unless I define explicit 
> dependency for the transitive dependencies in the child pom.
> My parent pom defines a <dependencyManagement/> section with all the 
> dependencies (scope, version) that is necessary for my child project directly 
> and indirectly (to override the transitive dependency of a an external 
> artifact - (spring-actionscript-core whose parent pom is 
> spring-actionscript-superpom-1.0.pom).
> The transitive dependencies of the spring-actionscript-core artifact are 
> defined with a different version to the one I have defined within the 
> <dependencyManagement/> section of my parent pom. 
> According to the precedence rules, the transitive dependencies of the 
> spring-actionscript-core artifact should be overridden by the version and 
> scope defined in the <dependencyManagement/> section of my parent pom.
> From the maven install execution log, I do not see that as the case. For 
> those artifacts I have explicitly defined within the <dependencies/> section 
> of the child pom, the transitive dependencies attributes have been overridden 
> with those defined in the <dependencyManagement/> section of the parent pom, 
> albeit looks like it is through mediation than management.
> Example artifacts are 
> com.adobe.flex.framework:framework:swc:3.5.0.12683:runtime (removed - nearer 
> found: 4.1.0.16076)
> com.adobe.flex.framework:rpc:swc:3.5.0.12683:runtime (removed - nearer found: 
> 4.1.0.16076)
> However, for those that are not explicitly defined, the transitive 
> dependencies remain with the version defined within the external artifact's 
> pom. Dependency mediation seems to rule.
> com.adobe.flex.framework:utilities:swc:3.5.0.12683:runtime (setting scope to: 
> compile)
> com.adobe.flex.framework:framework:rb.swc:3.5.0.12683:runtime (setting scope 
> to: compile)
> The debug output of maven install execution is as below:
> *[DEBUG]*   
> *org.springextensions.actionscript:spring-actionscript-core:swc:1.0:compile 
> (selected for compile)*
> [DEBUG]     com.adobe.flex.framework:flex:swc:3.5.0.12683:runtime (setting 
> scope to: compile)
> [DEBUG]     com.adobe.flex.framework:framework:swc:3.5.0.12683:runtime 
> (removed - nearer found: 4.1.0.16076)
> [DEBUG]     
> com.adobe.flex.framework:framework:zip:configs:4.1.0.16076:compile (removed - 
> nearer found: 3.5.0.12683)
> [DEBUG]     
> com.adobe.flex.framework:framework:zip:configs:3.5.0.12683:compile (selected 
> for compile)
> [DEBUG]     com.adobe.flex.framework:rpc:swc:3.5.0.12683:runtime (removed - 
> nearer found: 4.1.0.16076)
> [DEBUG]     com.adobe.flex.framework:utilities:swc:3.5.0.12683:runtime 
> (setting scope to: compile)
> [DEBUG]     com.adobe.flex.framework:playerglobal:swc:10:3.5.0.12683:runtime 
> (selected for runtime)
> [DEBUG]     com.adobe.flex.framework:framework:rb.swc:3.5.0.12683:runtime 
> (setting scope to: compile)
> [DEBUG]     com.adobe.flex.framework:rpc:rb.swc:3.5.0.12683:runtime (setting 
> scope to: compile)
> I have attached the following extracts for your perusal:
> i) Dependency Management section of the parent pom
> ii) Dependency declarations of the child pom
> iii) Pom of an external artifact that the child pom defines dependency
> If my understanding of the intended behaviour is flawed, apologies in 
> advance, much appreciate if you could provide me with an explanation to help 
> understand better.

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