Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 2.0
-
Fix Version/s: None
-
Component/s: Plugins and Lifecycle
-
Labels:None
-
Environment:HideLinux 2.6.10-gentoo-r4 #1 SMP Mon Jan 10 14:53:56 EST 2005 i686 AMD Athlon(tm) MP 2400+ AuthenticAMD GNU/Linux
java version "1.4.2_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-b05)
Java HotSpot(TM) Client VM (build 1.4.2_09-b05, mixed mode)ShowLinux 2.6.10-gentoo-r4 #1 SMP Mon Jan 10 14:53:56 EST 2005 i686 AMD Athlon(tm) MP 2400+ AuthenticAMD GNU/Linux java version "1.4.2_09" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_09-b05) Java HotSpot(TM) Client VM (build 1.4.2_09-b05, mixed mode)
-
Complexity:Intermediate
Description
Specifying a test-jar dependency clobbers any transitive dependency on
that project.
eg
projectA publishes jar and test-jar
projectB depends on projectA.jar (scope compile)
projectC depends on projectB.jar (scope compile) and projectA.test-jar
(scope test)
In projectC, the test scoped projectA.test-jar dependency effectively
clobbers the compile scoped transitive dependency on projectA.jar. ie
projectA.jar is no longer in projectC's compile scope dependency list.
If I explicitly specify the projectA.jar compile dependency in the projectC POM it is resolved correctly.
There are currently other issues with test-jar dependency
resolution that may be related.
MNG-1378 <http://jira.codehaus.org/browse/MNG-1378>
According to Brett "It shouldn't be clobbered, as
the conflict ID for a dependency is group:artifact:type:classifier" but this isn't what I am seeing.
Issue Links
- duplicates
-
MNG-1895
Dependencies in two paths are not added to resolution when scope needs to be updated in the nearest due to any of nearest parents
-
- is duplicated by
-
MNG-1823
dependencies with classifier mask transitive dependencies of same dependency without classifier
-
- is related to
-
MNG-1571
Wrong calculation of transient dependecies if artifact is referenced from different scopes
-
Here is a test case exhibiting this behaviour.
Based on it0077.
sub1 produces sub1.jar and sub1-test.jar
sub2 produces sub2.jar and sub2-test.jar
sub3 produces sub3.jar and sub3-test.jar
sub4 produces sub4.jar and sub4-test.jar
sub2 depends on sub1 scope compile
sub3 depends on sub2 and transitavely depends on sub1 scope compile
sub4 depends on sub3 and transitavely depends on sub1 and sub2 scope compile
sub4 additionally depends on sub2-test scope test
In sub4, if the sub2-test scope test dependency is omitted, testCompile fails as expected.
In sub4, if the sub2-test scope test dependency is included, compile fails due to the transitive dependency on sub1 being clobbered.