-
Bug
-
Resolution: Done
-
Major
-
2.0.0-alpha-6
-
None
-
None
A possible regression as similar code, using the old API, worked for me with Shrinkwrap-1.
Example: given the following dependency in the local pom.xml:
<dependencies>
...
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>rhq-core-client-api</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
...
</dependencies>
And the following SW-2 code:
MavenResolverSystem resolver = Maven.resolver();
resolver.loadPomFromFile("pom.xml").resolve("org.rhq:rhq-core-client-api:jar:tests:4.6.0-SNAPSHOT).withTransitivity().as(JavaArchive.class)
I don't get an exception but the retuened Archive is the production jar:
rhq-core-client-api-4.6.0-SNAPSHOT.jar
As opposed to the expected test jar:
rhq-core-client-api-4.6.0-SNAPSHOT-tests.jar
The test jar is generated by us in that module's pom, using the maven-jar plugin with phase=package and goal=test-jar, which I believe is the standard mechanism. And both of the jars are available in my M2 repo in the same place (.m2/repository/org/rhq/rhq-core-client-api/4.6.0-SNAPSHOT).
At the moment I have not been able to find a workaround.