You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sn...@apache.org on 2005/12/23 17:31:51 UTC

svn commit: r358826 - /maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java

Author: snicoll
Date: Fri Dec 23 08:31:47 2005
New Revision: 358826

URL: http://svn.apache.org/viewcvs?rev=358826&view=rev
Log:
MWAR-6: Fixed handling of includes and excludes settings ; Now handles comma separated values properly
Submitted by: David Hawkins
Reviewed by: Stéphane Nicoll

Modified:
    maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java

Modified: maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java
URL: http://svn.apache.org/viewcvs/maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java?rev=358826&r1=358825&r2=358826&view=diff
==============================================================================
--- maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java (original)
+++ maven/plugins/trunk/maven-war-plugin/src/main/java/org/apache/maven/plugin/war/AbstractWarMojo.java Fri Dec 23 08:31:47 2005
@@ -31,6 +31,7 @@
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
@@ -197,7 +198,7 @@
         List excludeList = new ArrayList();
         if ( StringUtils.isNotEmpty(warSourceExcludes) )
         {
-            excludeList.add( warSourceExcludes );
+            excludeList.addAll( Arrays.asList( StringUtils.split( warSourceExcludes, "," ) ) );
         }
 
         // if webXML is specified, omit the one in the source directory
@@ -217,7 +218,7 @@
      */
     protected String[] getIncludes()
     {
-        return new String[]{warSourceIncludes};
+        return StringUtils.split( StringUtils.defaultString( warSourceIncludes ), "," );
     }
     
     /**
@@ -227,13 +228,12 @@
      * @return an array of tokens to exclude
      */
     protected String[] getDependentWarExcludes() {
-        List excludeList = new ArrayList();
         if ( StringUtils.isNotEmpty(dependentWarExcludes) )
         {
-            excludeList.add( dependentWarExcludes );
+            return StringUtils.split( dependentWarExcludes, "," );
         }
 
-        return (String[]) excludeList.toArray( EMPTY_STRING_ARRAY );
+        return (String[]) EMPTY_STRING_ARRAY.clone();
     }
     
     /**
@@ -243,7 +243,7 @@
      * @return an array of tokens to include
      */
     protected String[] getDependentWarIncludes() {
-        return new String[] { dependentWarIncludes };
+        return StringUtils.split( StringUtils.defaultString( dependentWarIncludes ), "," );
     }
 
     public void buildExplodedWebapp( File webappDirectory )