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/02/12 16:02:43 UTC
svn commit: r1243262 - in /maven/release/trunk:
maven-release-manager/src/main/java/org/apache/maven/shared/release/exec/
maven-release-manager/src/main/java/org/apache/maven/shared/release/stax/
maven-release-plugin/src/it/projects/prepare/MRELEASE-53...
Author: rfscholte
Date: Sun Feb 12 15:02:42 2012
New Revision: 1243262
URL: http://svn.apache.org/viewvc?rev=1243262&view=rev
Log:
Fix MRELEASE-533: -Darguments ignored with InvokerMavenExecutor
Added:
maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/stax/
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-533/
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-533/other-pom.xml
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-533/test.properties
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-533/verify.groovy
Modified:
maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/exec/InvokerMavenExecutor.java
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-618/verify.groovy
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=1243262&r1=1243261&r2=1243262&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 Feb 12 15:02:42 2012
@@ -96,6 +96,8 @@ public class InvokerMavenExecutor
private static final String FAIL_AT_END = "fae";
private static final String FAIL_NEVER = "fn";
+
+ private static final String ALTERNATE_POM_FILE = "f";
static
{
@@ -158,6 +160,9 @@ public class InvokerMavenExecutor
OPTIONS.addOption( OptionBuilder.withLongOpt( "fail-never" ).withDescription(
"NEVER fail the build, regardless of project result" ).create( FAIL_NEVER ) );
+
+ OPTIONS.addOption( OptionBuilder.withLongOpt( "file" ).withDescription(
+ "Force the use of an alternate POM file." ).hasArg().create( ALTERNATE_POM_FILE ) );
}
// TODO: Configuring an invocation request from a command line could as well be part of the Invoker API
@@ -312,6 +317,17 @@ public class InvokerMavenExecutor
{
req.setFailureBehavior( InvocationRequest.REACTOR_FAIL_NEVER );
}
+ if ( cli.hasOption( ALTERNATE_POM_FILE ) )
+ {
+ if ( req.getPomFileName() != null )
+ {
+ getLogger().info( "pomFileName is already set, ignoring the -f argument" );
+ }
+ else
+ {
+ req.setPomFileName( cli.getOptionValue( ALTERNATE_POM_FILE ) );
+ }
+ }
}
catch ( Exception e )
{
Added: maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-533/other-pom.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-533/other-pom.xml?rev=1243262&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-533/other-pom.xml (added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-533/other-pom.xml Sun Feb 12 15:02:42 2012
@@ -0,0 +1,48 @@
+<?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-533</artifactId>
+ <version>1.0-SNAPSHOT</version>
+
+ <scm>
+ <connection>scm:dummy|nul</connection>
+ <developerConnection>scm:dummy|nul</developerConnection>
+ </scm>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-release-plugin</artifactId>
+ <version>@project.version@</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.its.release</groupId>
+ <artifactId>maven-scm-provider-dummy</artifactId>
+ <version>1.0</version>
+ </dependency>
+ </dependencies>
+ </plugin>
+ </plugins>
+ </build>
+</project>
\ No newline at end of file
Added: maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-533/test.properties
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-533/test.properties?rev=1243262&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-533/test.properties (added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-533/test.properties Sun Feb 12 15:02:42 2012
@@ -0,0 +1 @@
+arguments = -f other-pom.xml
\ No newline at end of file
Added: maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-533/verify.groovy
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-533/verify.groovy?rev=1243262&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-533/verify.groovy (added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-533/verify.groovy Sun Feb 12 15:02:42 2012
@@ -0,0 +1,24 @@
+
+/*
+ * 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.
+ */
+
+File buildLog = new File( basedir, 'build.log' )
+assert buildLog.exists()
+
+assert 1 == buildLog.getText().count("[DEBUG] Specified POM file is not named 'pom.xml'. Using the '-f' command-line option to accommodate non-standard filename...")
Modified: maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-618/verify.groovy
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-618/verify.groovy?rev=1243262&r1=1243261&r2=1243262&view=diff
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-618/verify.groovy (original)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-618/verify.groovy Sun Feb 12 15:02:42 2012
@@ -21,4 +21,4 @@
File buildLog = new File( basedir, 'build.log' )
assert buildLog.exists()
-assert 1 == buildLog.getText().count('[DEBUG] Specified POM file is not named 'pom.xml'. Using the '-f' command-line option to accommodate non-standard filename...')
+assert 1 == buildLog.getText().count("[DEBUG] Specified POM file is not named 'pom.xml'. Using the '-f' command-line option to accommodate non-standard filename...")