You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jd...@apache.org on 2008/09/10 21:02:44 UTC

svn commit: r693929 - in /maven/components/branches/maven-2.0.x: maven-core/src/main/java/org/apache/maven/cli/MavenCli.java maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java pom.xml

Author: jdcasey
Date: Wed Sep 10 12:02:41 2008
New Revision: 693929

URL: http://svn.apache.org/viewvc?rev=693929&view=rev
Log:
roll back to modello alpha-13 to avoid problems with strict flag and illegal elements in settings.xml, and merge profile deactivation and multiple profile options on the cli back into 2.0.x

Modified:
    maven/components/branches/maven-2.0.x/maven-core/src/main/java/org/apache/maven/cli/MavenCli.java
    maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java
    maven/components/branches/maven-2.0.x/pom.xml

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=693929&r1=693928&r2=693929&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 Wed Sep 10 12:02:41 2008
@@ -239,26 +239,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 );
+                            }
+                        }
                     }
                 }
             }

Modified: maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java?rev=693929&r1=693928&r2=693929&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java (original)
+++ maven/components/branches/maven-2.0.x/maven-project/src/main/java/org/apache/maven/profiles/DefaultProfileManager.java Wed Sep 10 12:02:41 2008
@@ -265,7 +265,10 @@
 
                 if ( activator.canDetermineActivation( profile ) )
                 {
-                    return activator.isActive( profile );
+                    if ( activator.isActive( profile ) )
+                    {
+                        return true;
+                    }
                 }
             }
 

Modified: maven/components/branches/maven-2.0.x/pom.xml
URL: http://svn.apache.org/viewvc/maven/components/branches/maven-2.0.x/pom.xml?rev=693929&r1=693928&r2=693929&view=diff
==============================================================================
--- maven/components/branches/maven-2.0.x/pom.xml (original)
+++ maven/components/branches/maven-2.0.x/pom.xml Wed Sep 10 12:02:41 2008
@@ -195,7 +195,7 @@
         <plugin>
           <groupId>org.codehaus.modello</groupId>
           <artifactId>modello-maven-plugin</artifactId>
-          <version>1.0-alpha-20</version>
+          <version>1.0-alpha-13</version>
           <executions>
             <execution>
               <id>site-docs</id>