maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pg...@apache.org
Subject svn commit: r652910 - /maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
Date Fri, 02 May 2008 21:02:01 GMT
Author: pgier
Date: Fri May  2 14:02:00 2008
New Revision: 652910

URL: http://svn.apache.org/viewvc?rev=652910&view=rev
Log:
[MNG-3268] Adding handling of multiple -P params on the command line.

Modified:
    maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java

Modified: maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java?rev=652910&r1=652909&r2=652910&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
(original)
+++ maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
Fri May  2 14:02:00 2008
@@ -240,26 +240,32 @@
 
             if ( commandLine.hasOption( CLIManager.ACTIVATE_PROFILES ) )
             {
-                String profilesLine = commandLine.getOptionValue( CLIManager.ACTIVATE_PROFILES
);
+                String [] profileOptionValues = commandLine.getOptionValues( CLIManager.ACTIVATE_PROFILES
);
 
-                StringTokenizer profileTokens = new StringTokenizer( profilesLine, "," );
-
-                while ( profileTokens.hasMoreTokens() )
+                if ( profileOptionValues != null )
                 {
-                    String profileAction = profileTokens.nextToken().trim();
-
-                    if ( profileAction.startsWith( "-" ) )
-                    {
-                        profileManager.explicitlyDeactivate( profileAction.substring( 1 )
);
-                    }
-                    else if ( profileAction.startsWith( "+" ) )
+                    for ( int i=0; i < profileOptionValues.length; ++i )
                     {
-                        profileManager.explicitlyActivate( profileAction.substring( 1 ) );
-                    }
-                    else
-                    {
-                        // TODO: deprecate this eventually!
-                        profileManager.explicitlyActivate( profileAction );
+                        StringTokenizer profileTokens = new StringTokenizer( profileOptionValues[i],
"," );
+
+                        while ( profileTokens.hasMoreTokens() )
+                        {
+                            String profileAction = profileTokens.nextToken().trim();
+
+                            if ( profileAction.startsWith( "-" ) )
+                            {
+                                profileManager.explicitlyDeactivate( profileAction.substring(
1 ) );
+                            }
+                            else if ( profileAction.startsWith( "+" ) )
+                            {
+                                profileManager.explicitlyActivate( profileAction.substring(
1 ) );
+                            }
+                            else
+                            {
+                                // TODO: deprecate this eventually!
+                                profileManager.explicitlyActivate( profileAction );
+                            }
+                        }
                     }
                 }
             }



Mime
View raw message