Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.2.1
-
Fix Version/s: 1.2.2
-
Labels:None
-
Environment:Maven 2.0.9
JDK 1.5.0_12
-
Patch Submitted:Yes
-
Number of attachments :
Description
When adding a jar to be shaded that has a classifier, it is ignored and will still be in the modified pom.
Example as follows:
pom.xml
...
<dependencies>
<!-- Interna beroenden -->
<dependency>
<groupId>org.company.foo</groupId>
<artifactId>my-ejb</artifactId>
<version>0.0.1</version>
<classifier>client</classifier>
</dependency>
<dependency>
<groupId>org.company.foo</groupId>
<artifactId>domain</artifactId>
<version>0.0.1</version>
</dependency>
....
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>false</shadedArtifactAttached>
<createDependencyReducedPom>true</createDependencyReducedPom>
<artifactSet>
<includes>
<include>org.company.foo:my-ejb:client</include>
<include>org.company.foo:domain</include>
</includes>
</artifactSet>
<excludeTransitive>true</excludeTransitive>
</configuration>
</execution>
</executions>
</plugin>
....
It will shade the two jars, but my-ejb will stil be in the modified pom
Since it annoys me I've fixed the issue, you can find it in the attached patch.
Usecase: You package an ejb and ejb-client with the usual plugin. And since the dependency tree for said client inherents the one for the main jar, it is preferable to wrap it in a separate module, with for instance the domain-module and with its own sets of dependencies.
/Jonas