You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2012/12/02 20:03:11 UTC
svn commit: r1416235 - in /maven/release/trunk:
maven-release-manager/src/main/java/org/apache/maven/shared/release/exec/
maven-release-plugin/src/it/projects/perform/MRELEASE-592/
Author: rfscholte
Date: Sun Dec 2 19:03:10 2012
New Revision: 1416235
URL: http://svn.apache.org/viewvc?rev=1416235&view=rev
Log:
[MRELEASE-592] Please allow de-activation of profiles
Added:
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-592/
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-592/pom.xml
Modified:
maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/exec/InvokerMavenExecutor.java
Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/exec/InvokerMavenExecutor.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/exec/InvokerMavenExecutor.java?rev=1416235&r1=1416234&r2=1416235&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/exec/InvokerMavenExecutor.java (original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/exec/InvokerMavenExecutor.java Sun Dec 2 19:03:10 2012
@@ -19,6 +19,13 @@ package org.apache.maven.shared.release.
* under the License.
*/
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Properties;
+
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.Options;
@@ -36,17 +43,8 @@ import org.apache.maven.shared.release.R
import org.apache.maven.shared.release.env.ReleaseEnvironment;
import org.codehaus.plexus.logging.Logger;
import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.StringUtils;
import org.codehaus.plexus.util.cli.CommandLineUtils;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-import java.util.StringTokenizer;
-
/**
* Fork Maven using the maven-invoker shared library.
*
@@ -248,45 +246,10 @@ public class InvokerMavenExecutor
if ( cli.hasOption( ACTIVATE_PROFILES ) )
{
String[] profiles = cli.getOptionValues( ACTIVATE_PROFILES );
- List<String> activatedProfiles = new ArrayList<String>();
- List<String> deactivatedProfiles = new ArrayList<String>();
-
+
if ( profiles != null )
{
- for ( int i = 0; i < profiles.length; ++i )
- {
- StringTokenizer profileTokens = new StringTokenizer( profiles[i], "," );
-
- while ( profileTokens.hasMoreTokens() )
- {
- String profileAction = profileTokens.nextToken().trim();
-
- if ( profileAction.startsWith( "-" ) || profileAction.startsWith( "!" ) )
- {
- deactivatedProfiles.add( profileAction.substring( 1 ) );
- }
- else if ( profileAction.startsWith( "+" ) )
- {
- activatedProfiles.add( profileAction.substring( 1 ) );
- }
- else
- {
- activatedProfiles.add( profileAction );
- }
- }
- }
- }
-
- if ( !deactivatedProfiles.isEmpty() )
- {
- getLogger().warn( "Explicit profile deactivation is not yet supported. "
- + "The following profiles will NOT be deactivated: " + StringUtils.join(
- deactivatedProfiles.iterator(), ", " ) );
- }
-
- if ( !activatedProfiles.isEmpty() )
- {
- req.setProfiles( activatedProfiles );
+ req.setProfiles( Arrays.asList( profiles ) );
}
}
Added: maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-592/pom.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-592/pom.xml?rev=1416235&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-592/pom.xml (added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-592/pom.xml Sun Dec 2 19:03:10 2012
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more
+ contributor license agreements. See the NOTICE file ~ distributed with this
+ work for additional information ~ regarding copyright ownership. The ASF
+ licenses this file ~ to you under the Apache License, Version 2.0 (the ~
+ "License"); you may not use this file except in compliance ~ with the License.
+ You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0
+ ~ ~ Unless required by applicable law or agreed to in writing, ~ software
+ distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT
+ WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the
+ License for the ~ specific language governing permissions and limitations
+ ~ under the License. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.maven.plugin.release.its</groupId>
+ <artifactId>mrelease-592</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <scm>
+ <connection>scm:dummy|nul</connection>
+ <developerConnection>scm:dummy|nul</developerConnection>
+ </scm>
+
+ <distributionManagement>
+ <snapshotRepository>
+ <id>dummy</id>
+ <url>dummy:nul</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.its.release</groupId>
+ <artifactId>wagon-provider-dummy</artifactId>
+ <version>1.0</version>
+ </extension>
+ </extensions>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>@project.version@</version>
+ <configuration>
+ <preparationGoals>clean</preparationGoals>
+ <releaseProfiles>release,!integration-tests</releaseProfiles>
+ </configuration>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.its.release</groupId>
+ <artifactId>maven-scm-provider-dummy</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>release</id>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.1.1</version>
+ <executions>
+ <execution>
+ <id>enforce</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <AlwaysPass />
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>integration-tests</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-enforcer-plugin</artifactId>
+ <version>1.1.1</version>
+ <executions>
+ <execution>
+ <id>enforce</id>
+ <goals>
+ <goal>enforce</goal>
+ </goals>
+ <configuration>
+ <rules>
+ <AlwaysFail />
+ </rules>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
\ No newline at end of file