maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From denn...@apache.org
Subject svn commit: r589217 - in /maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source: AbstractSourceJarMojo.java SourceJarMojo.java TestSourceJarMojo.java
Date Sat, 27 Oct 2007 21:07:45 GMT
Author: dennisl
Date: Sat Oct 27 14:07:44 2007
New Revision: 589217

URL: http://svn.apache.org/viewvc?rev=589217&view=rev
Log:
[MSOURCES-22] configuration option for source:jar to exclude resources

Modified:
    maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java
    maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/SourceJarMojo.java
    maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/TestSourceJarMojo.java

Modified: maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java?rev=589217&r1=589216&r2=589217&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java
(original)
+++ maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractSourceJarMojo.java
Sat Oct 27 14:07:44 2007
@@ -55,6 +55,15 @@
     private boolean attach;
 
     /**
+     * Specifies whether or not to exclude resources from the sources-jar. This
+     * can be convenient if your project includes large resources, such as
+     * images, and you don't want to include them in the sources-jar.
+     *
+     * @parameter expression="${source.excludeResources}" default-value="false"
+     */
+    protected boolean excludeResources;
+
+    /**
      * @component
      */
     private MavenProjectHelper projectHelper;

Modified: maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/SourceJarMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/SourceJarMojo.java?rev=589217&r1=589216&r2=589217&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/SourceJarMojo.java
(original)
+++ maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/SourceJarMojo.java
Sat Oct 27 14:07:44 2007
@@ -20,11 +20,9 @@
  */
 
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.model.Resource;
 
+import java.util.Collections;
 import java.util.List;
-import java.util.ArrayList;
-import java.util.Iterator;
 
 /**
  * This plugin bundles all the sources into a jar archive.
@@ -45,7 +43,14 @@
 
     protected List getResources( MavenProject project )
     {
-        return project.getResources();
+        if ( excludeResources )
+        {
+            return Collections.EMPTY_LIST;
+        }
+        else
+        {
+            return project.getResources();
+        }
     }
 
     protected String getClassifier()

Modified: maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/TestSourceJarMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/TestSourceJarMojo.java?rev=589217&r1=589216&r2=589217&view=diff
==============================================================================
--- maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/TestSourceJarMojo.java
(original)
+++ maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/TestSourceJarMojo.java
Sat Oct 27 14:07:44 2007
@@ -20,11 +20,9 @@
  */
 
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.model.Resource;
 
+import java.util.Collections;
 import java.util.List;
-import java.util.ArrayList;
-import java.util.Iterator;
 
 /**
  * This plugin bundles all the test sources into a jar archive.
@@ -43,7 +41,14 @@
 
     protected List getResources( MavenProject project )
     {
-        return project.getTestResources();
+        if ( excludeResources )
+        {
+            return Collections.EMPTY_LIST;
+        }
+        else
+        {
+            return project.getTestResources();
+        }
     }
 
     protected String getClassifier()



Mime
View raw message