You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by be...@apache.org on 2009/12/29 23:06:00 UTC
svn commit: r894492 - in /maven/plugins/trunk/maven-shade-plugin/src:
it/filter-artifact-contents/
it/filter-artifact-contents/repo/org/apache/maven/its/shade/fac/b/0.1/
main/java/org/apache/maven/plugins/shade/mojo/
test/java/org/apache/maven/plugins/...
Author: bentmann
Date: Tue Dec 29 22:05:59 2009
New Revision: 894492
URL: http://svn.apache.org/viewvc?rev=894492&view=rev
Log:
o Synced pattern syntax for filters with existing syntax for artifactSet
Added:
maven/plugins/trunk/maven-shade-plugin/src/it/filter-artifact-contents/repo/org/apache/maven/its/shade/fac/b/0.1/b-0.1-client.jar
- copied unchanged from r894489, maven/plugins/trunk/maven-shade-plugin/src/it/filter-artifact-contents/repo/org/apache/maven/its/shade/fac/b/0.1/b-0.1.jar
Removed:
maven/plugins/trunk/maven-shade-plugin/src/it/filter-artifact-contents/repo/org/apache/maven/its/shade/fac/b/0.1/b-0.1.jar
Modified:
maven/plugins/trunk/maven-shade-plugin/src/it/filter-artifact-contents/pom.xml
maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ArtifactId.java
maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java
maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/mojo/ArtifactIdTest.java
Modified: maven/plugins/trunk/maven-shade-plugin/src/it/filter-artifact-contents/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/it/filter-artifact-contents/pom.xml?rev=894492&r1=894491&r2=894492&view=diff
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/it/filter-artifact-contents/pom.xml (original)
+++ maven/plugins/trunk/maven-shade-plugin/src/it/filter-artifact-contents/pom.xml Tue Dec 29 22:05:59 2009
@@ -55,6 +55,7 @@
<groupId>org.apache.maven.its.shade.fac</groupId>
<artifactId>b</artifactId>
<version>0.1</version>
+ <classifier>client</classifier>
</dependency>
</dependencies>
@@ -81,7 +82,7 @@
</includes>
</filter>
<filter>
- <artifact>org.apache.maven.its.shade.fac:b</artifact>
+ <artifact>org.apache.maven.its.shade.fac:b:client</artifact>
<excludes>
<exclude>org/apache/*</exclude>
</excludes>
Modified: maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ArtifactId.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ArtifactId.java?rev=894492&r1=894491&r2=894492&view=diff
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ArtifactId.java (original)
+++ maven/plugins/trunk/maven-shade-plugin/src/main/java/org/apache/maven/plugins/shade/mojo/ArtifactId.java Tue Dec 29 22:05:59 2009
@@ -64,8 +64,8 @@
}
groupId = ( tokens.length > 0 ) ? tokens[0] : "";
artifactId = ( tokens.length > 1 ) ? tokens[1] : "";
- type = ( tokens.length > 2 ) ? tokens[2] : "*";
- classifier = ( tokens.length > 3 ) ? tokens[3] : "*";
+ type = ( tokens.length > 3 ) ? tokens[2] : "*";
+ classifier = ( tokens.length > 3 ) ? tokens[3] : ( ( tokens.length > 2 ) ? tokens[2] : "*" );
}
public String getGroupId()
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=894492&r1=894491&r2=894492&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 Dec 29 22:05:59 2009
@@ -198,11 +198,11 @@
* contents of the archive are added to the shaded jar. Just like the include/exclude patterns, the artifact
* coordinates for the filter support the wildcard characters '*' and '?'. For convenience, the syntax
* <code>groupId:artifactId</code> is equivalent to <code>groupId:artifactId:*:*</code> and
- * <code>groupId:artifactId:type</code> is equivalent to <code>groupId:artifactId:type:*</code>. From a logical
- * perspective, includes are processed before excludes, thus it's possible to use an include to collect a set of
- * files from the archive then use excludes to further reduce the set. By default, all files are included and no
- * files are excluded. If multiple filters apply to an artifact, the intersection of the matched files will be
- * included.
+ * <code>groupId:artifactId:classifier</code> is equivalent to <code>groupId:artifactId:*:classifier</code>. From a
+ * logical perspective, includes are processed before excludes, thus it's possible to use an include to collect a
+ * set of files from the archive then use excludes to further reduce the set. By default, all files are included and
+ * no files are excluded. If multiple filters apply to an artifact, the intersection of the matched files will be
+ * included in the final JAR.
*
* @parameter
*/
Modified: maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/mojo/ArtifactIdTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/mojo/ArtifactIdTest.java?rev=894492&r1=894491&r2=894492&view=diff
==============================================================================
--- maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/mojo/ArtifactIdTest.java (original)
+++ maven/plugins/trunk/maven-shade-plugin/src/test/java/org/apache/maven/plugins/shade/mojo/ArtifactIdTest.java Tue Dec 29 22:05:59 2009
@@ -61,14 +61,14 @@
id = new ArtifactId( "gid:aid:" );
assertEquals( "gid", id.getGroupId() );
assertEquals( "aid", id.getArtifactId() );
- assertEquals( "", id.getType() );
- assertEquals( "*", id.getClassifier() );
+ assertEquals( "*", id.getType() );
+ assertEquals( "", id.getClassifier() );
- id = new ArtifactId( "gid:aid:type" );
+ id = new ArtifactId( "gid:aid:cls" );
assertEquals( "gid", id.getGroupId() );
assertEquals( "aid", id.getArtifactId() );
- assertEquals( "type", id.getType() );
- assertEquals( "*", id.getClassifier() );
+ assertEquals( "*", id.getType() );
+ assertEquals( "cls", id.getClassifier() );
id = new ArtifactId( "gid:aid:type:cls" );
assertEquals( "gid", id.getGroupId() );
@@ -121,10 +121,11 @@
assertFalse( new ArtifactId( "gid", "aid", "Type", "cls" ).matches( new ArtifactId( "gid:aid:type:cls" ) ) );
assertFalse( new ArtifactId( "gid", "aid", "type", "Cls" ).matches( new ArtifactId( "gid:aid:type:cls" ) ) );
- assertTrue( new ArtifactId( "gid", "aid", "type", "" ).matches( new ArtifactId( "gid:aid:type" ) ) );
- assertTrue( new ArtifactId( "gid", "aid", "type", "cls" ).matches( new ArtifactId( "gid:aid:type" ) ) );
- assertFalse( new ArtifactId( "id", "aid", "type", "" ).matches( new ArtifactId( "gid:aid:type" ) ) );
- assertFalse( new ArtifactId( "gid", "id", "type", "" ).matches( new ArtifactId( "gid:aid:type" ) ) );
+ assertTrue( new ArtifactId( "gid", "aid", "any", "cls" ).matches( new ArtifactId( "gid:aid:cls" ) ) );
+ assertTrue( new ArtifactId( "gid", "aid", "type", "cls" ).matches( new ArtifactId( "gid:aid:cls" ) ) );
+ assertFalse( new ArtifactId( "id", "aid", "type", "cls" ).matches( new ArtifactId( "gid:aid:cls" ) ) );
+ assertFalse( new ArtifactId( "gid", "id", "type", "cls" ).matches( new ArtifactId( "gid:aid:cls" ) ) );
+ assertFalse( new ArtifactId( "gid", "id", "type", "ls" ).matches( new ArtifactId( "gid:aid:cls" ) ) );
assertTrue( new ArtifactId( "gid", "aid", "type", "" ).matches( new ArtifactId( "gid:aid" ) ) );
assertTrue( new ArtifactId( "gid", "aid", "any", "tests" ).matches( new ArtifactId( "gid:aid" ) ) );