Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 2.0.1
-
Fix Version/s: None
-
Component/s: Inheritance and Interpolation
-
Labels:None
-
Complexity:Expert
-
Number of attachments :
Description
A module in cocoon has following dependencies :
<dependency>
<groupId>org.apache.cocoon</groupId>
<artifactId>cocoon-core</artifactId>
<version>2.2.0-SNAPSHOT</version>
<classifier>tests</classifier>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.cocoon</groupId>
<artifactId>cocoon-core</artifactId>
<version>2.2.0-SNAPSHOT</version>
</dependency>
The first dependency is created by the core module using :
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
Now i would like the module to depend on the jar with classifier "tests" during the testing phase ie cocoon-core-2.2.0-SNAPSHOT-tests.jar, and during the normal compilation phase it should just use cocoon-core-2.2.0-SNAPSHOT.jar. IMO above dependencies express exactly this.
The problem is that maven somehow removes all transitive dependencies from cocoon-core-2.2.0-SNAPSHOT.jar when both dependencies are in place, breaking compilation. When i remove the dependency with the classifier, then all is fine (but ofcourse my tests can't run)
I hope above is clear, otherwise just ping me on irc
Issue Links
| This issue duplicates: | ||||
| MNG-1568 | test-jar dependency clobbers transitive dependency |
|
|
|
| This issue relates to: | ||||
| MNG-2759 | Resolving transitive dependencies of artefacts with classifiers fails |
|
|
|
| This issue is related to: | ||||
| MNG-3555 | transitive dependency exclusion fails when classifier specified |
|
|
|
| This issue depends upon: | ||||
| MNG-1378 | Make dependencies of test-jars transitive |
|
|
|
| MNG-1571 | Wrong calculation of transient dependecies if artifact is referenced from different scopes |
|
|
|
You should use <type>test-jar</type> instead of classifier, see http://maven.apache.org/guides/mini/guide-attached-tests.html