Author: cziegeler
Date: Thu Aug 30 15:14:33 2012
New Revision: 1378983

URL: http://svn.apache.org/viewvc?rev=1378983&view=rev
Log:
SLING-2590 :  Provide a way to exclude configurations from partial bundle lists 

Modified:
    
sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java

Modified: 
sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
URL: 
http://svn.apache.org/viewvc/sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java?rev=1378983&r1=1378982&r2=1378983&view=diff
==============================================================================
--- 
sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
 (original)
+++ 
sling/trunk/maven/maven-launchpad-plugin/src/main/java/org/apache/sling/maven/projectsupport/AbstractUsingBundleListMojo.java
 Thu Aug 30 15:14:33 2012
@@ -38,6 +38,7 @@ import org.apache.sling.maven.projectsup
 import org.codehaus.plexus.archiver.ArchiverException;
 import org.codehaus.plexus.archiver.zip.ZipUnArchiver;
 import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.StringUtils;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 import org.drools.KnowledgeBase;
 import org.drools.KnowledgeBaseFactory;
@@ -107,6 +108,22 @@ public abstract class AbstractUsingBundl
     private File[] rewriteRuleFiles;
 
     /**
+     * The comma separated list of tokens to include when copying configs
+     * from partial bundle lists.
+     *
+     * @parameter default-value="**"
+     */
+    private String[] configIncludes;
+
+    /**
+     * The comma separated list of tokens to exclude when copying the configs
+     * from partial bundle lists.
+     *
+     * @parameter
+     */
+    private String[] configExcludes;
+
+    /**
      * @component
      */
     protected MavenFileFilter mavenFileFilter;
@@ -312,8 +329,16 @@ public abstract class AbstractUsingBundl
                         this.tempConfigDir.mkdirs();
                         this.overlayConfigDir = this.tempConfigDir;
                     }
+                    String excludes = FileUtils.getDefaultExcludesAsString();
+                    if ( this.configExcludes != null ) {
+                        excludes = excludes + ',' + 
StringUtils.join(this.configExcludes, ",");
+                    }
+                    String includes = null;
+                    if ( this.configIncludes != null ) {
+                        includes = StringUtils.join(this.configIncludes, ",");
+                    }
                     FileUtils.copyDirectory(configDir, this.overlayConfigDir,
-                            null, FileUtils.getDefaultExcludesAsString());
+                                    includes, excludes);
                 }
             } catch (final ArchiverException ae) {
                 throw new MojoExecutionException("Unable to extract 
configuration archive.",ae);


Reply via email to