geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdil...@apache.org
Subject svn commit: r440113 - /geronimo/genesis/trunk/plugins/maven-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/maven/InvokeMavenMojo.java
Date Mon, 04 Sep 2006 15:54:57 GMT
Author: jdillon
Date: Mon Sep  4 08:54:56 2006
New Revision: 440113

URL: http://svn.apache.org/viewvc?view=rev&rev=440113
Log:
Add profiles config

Modified:
    geronimo/genesis/trunk/plugins/maven-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/maven/InvokeMavenMojo.java

Modified: geronimo/genesis/trunk/plugins/maven-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/maven/InvokeMavenMojo.java
URL: http://svn.apache.org/viewvc/geronimo/genesis/trunk/plugins/maven-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/maven/InvokeMavenMojo.java?view=diff&rev=440113&r1=440112&r2=440113
==============================================================================
--- geronimo/genesis/trunk/plugins/maven-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/maven/InvokeMavenMojo.java
(original)
+++ geronimo/genesis/trunk/plugins/maven-maven-plugin/src/main/java/org/apache/geronimo/genesis/plugins/maven/InvokeMavenMojo.java
Mon Sep  4 08:54:56 2006
@@ -68,6 +68,13 @@
     private Map parameters = null;
 
     /**
+     * A set of profiles to activate via -P
+     *
+     * @parameter
+     */
+    private String[] profiles = null;
+
+    /**
      * A set of goals (or phases) to be invoked.
      *
      * @parameter
@@ -115,7 +122,7 @@
         exec.setFailonerror(true);
 
         if (flags != null) {
-            for (int i=0; i< flags.length; i++) {
+            for (int i=0; i < flags.length; i++) {
                 exec.createArg().setValue(flags[i]);
             }
         }
@@ -129,8 +136,21 @@
             }
         }
 
+        if (profiles != null && profiles.length != 0) {
+            StringBuffer buff = new StringBuffer("-P");
+            
+            for (int i=0; i < profiles.length; i++) {
+                buff.append(profiles[i]);
+                if (i + 1 < profiles.length) {
+                    buff.append(",");
+                }
+            }
+
+            exec.createArg().setValue(buff.toString());
+        }
+
         if (goals != null) {
-            for (int i=0; i< goals.length; i++) {
+            for (int i=0; i < goals.length; i++) {
                 exec.createArg().setValue(goals[i]);
             }
         }



Mime
View raw message