You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2008/05/13 16:26:09 UTC

svn commit: r655877 - /maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java

Author: jvanzyl
Date: Tue May 13 07:26:09 2008
New Revision: 655877

URL: http://svn.apache.org/viewvc?rev=655877&view=rev
Log:
MSHADE-34: Making the inclusion of artifacts with classifiers explicit. This also avoids the problem of having test jars included when the only desired inclusion is the primary artifact.
Submitted by: Hiram Chirino


Modified:
    maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java

Modified: maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java?rev=655877&r1=655876&r2=655877&view=diff
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java (original)
+++ maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java Tue May 13 07:26:09 2008
@@ -60,6 +60,7 @@
  * @author Jason van Zyl
  * @author Mauro Talevi
  * @author David Blevins
+ * @author Hiram Chirino
  * @goal shade
  * @phase package
  * @requiresDependencyResolution runtime
@@ -703,6 +704,13 @@
 
     private String getId( Artifact artifact )
     {
-        return artifact.getGroupId() + ":" + artifact.getArtifactId();
+        if ( artifact.getClassifier() == null || "jar".equals( artifact.getClassifier() ) )
+        {
+            return artifact.getGroupId() + ":" + artifact.getArtifactId();
+        }
+        else
+        {
+            return artifact.getGroupId() + ":" + artifact.getArtifactId() + ":" + artifact.getClassifier();
+        }
     }
 }