Tom Boettcher created MNG-5341:
----------------------------------

             Summary: Dependency plugin may treat transitive dependencies as 
direct dependencies
                 Key: MNG-5341
                 URL: https://jira.codehaus.org/browse/MNG-5341
             Project: Maven 2 & 3
          Issue Type: Bug
          Components: Dependencies
    Affects Versions: 3.0.4
            Reporter: Tom Boettcher


[Git repo|https://github.com/tboettch/maven-test] containing sample projects 
illustrating the bug.

When two artifacts sharing an artifact ID but with different classifiers are 
both dependencies of a project, one of them being a direct dependency will 
cause the other to also be treated as a direct dependency, even if it is 
transitive.

>From the repository linked above:
{quote}
Project Relationships:
* projectA produces two artifacts with different classifiers: projectA and 
projectA-someclassifier.
* projectB depends directly on projectA-someclassifier (and also junit, for 
illustration purposes).
* projectC depends directly on projectB and projectA (note the lack of 
classifier) and transitively on projectA-someclassifier and junit.

To see the bug, install projectA and projectB to your local repository, then 
run the following commands on projectC:

* {{mvn dependency:resolve}}
* {{mvn dependency:resolve -DexcludeTransitive=true}}

In the latter case, projectA-someclassifier should be excluded from the list, 
but it is actually included. Note that the "ordinary" transitive dependency of 
junit is excluded, as expected. Furthermore, try running those same commands 
again after removing projectA from projectC's dependencies: with the second 
command, projectA and projectA-someclassifier both disappear from the list, 
even though only the direct dependency was changed!
{quote}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to