Author: gboue
Date: Fri Nov 11 15:32:18 2016
New Revision: 1769304

URL: http://svn.apache.org/viewvc?rev=1769304&view=rev
Log:
[MRELEASE-966] release plugin does not respect "mvn -f"

The prepare and perform goals execute goals against the given pomFileName. This 
should default to the name of the POM file of the project being built (it can 
be something else than pom.xml when running Maven with the -f option).

Added:
    
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/
    
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/invoker.properties
   (with props)
    
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/my-pom.xml
   (with props)
    
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/pom.xml
   (with props)
    
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/verify.groovy
   (with props)
Modified:
    maven/release/trunk/maven-release-plugin/pom.xml
    
maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java

Modified: maven/release/trunk/maven-release-plugin/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/pom.xml?rev=1769304&r1=1769303&r2=1769304&view=diff
==============================================================================
--- maven/release/trunk/maven-release-plugin/pom.xml (original)
+++ maven/release/trunk/maven-release-plugin/pom.xml Fri Nov 11 15:32:18 2016
@@ -220,6 +220,9 @@
                     <pomInclude>projects/prepare/*/*pom.xml</pomInclude>
                     
<pomInclude>projects/prepare/flat-multi-module/parent-project/pom.xml</pomInclude>
                   </pomIncludes>
+                  <pomExcludes>
+                    
<pomExclude>projects/prepare/MRELEASE-966/pom.xml</pomExclude>
+                  </pomExcludes>
                   <goals>
                     <goal>clean</goal>
                     
<goal>${project.groupId}:${project.artifactId}:${project.version}:clean</goal>

Added: 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/invoker.properties
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/invoker.properties?rev=1769304&view=auto
==============================================================================
--- 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/invoker.properties
 (added)
+++ 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/invoker.properties
 Fri Nov 11 15:32:18 2016
@@ -0,0 +1,18 @@
+# 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.
+
+invoker.project = my-pom.xml
\ No newline at end of file

Propchange: 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/invoker.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/invoker.properties
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/my-pom.xml
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/my-pom.xml?rev=1769304&view=auto
==============================================================================
--- 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/my-pom.xml
 (added)
+++ 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/my-pom.xml
 Fri Nov 11 15:32:18 2016
@@ -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-966-my-pom</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

Propchange: 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/my-pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/my-pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/pom.xml?rev=1769304&view=auto
==============================================================================
--- 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/pom.xml
 (added)
+++ 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/pom.xml
 Fri Nov 11 15:32:18 2016
@@ -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-966-pom</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

Propchange: 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Added: 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/verify.groovy
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/verify.groovy?rev=1769304&view=auto
==============================================================================
--- 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/verify.groovy
 (added)
+++ 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/verify.groovy
 Fri Nov 11 15:32:18 2016
@@ -0,0 +1,27 @@
+
+/*
+ * 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 3 == buildLog.getText().count("[INFO] Building mrelease-966-my-pom 
1.0-SNAPSHOT")
+assert 0 == buildLog.getText().count("[INFO] Building mrelease-966-pom 
1.0-SNAPSHOT")
+assert 1 == buildLog.getText().count("[INFO] [INFO] Building 
mrelease-966-my-pom 1.0-SNAPSHOT")
+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...")

Propchange: 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/verify.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: 
maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-966/verify.groovy
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Modified: 
maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java?rev=1769304&r1=1769303&r2=1769304&view=diff
==============================================================================
--- 
maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
 (original)
+++ 
maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractReleaseMojo.java
 Fri Nov 11 15:32:18 2016
@@ -75,9 +75,10 @@ public abstract class AbstractReleaseMoj
     private String arguments;
 
     /**
-     * The file name of the POM to execute any goals against.
+     * The file name of the POM to execute any goals against. As of version 
3.0.0, this defaults to the name of
+     * POM file of the project being built.
      */
-    @Parameter( property = "pomFileName" )
+    @Parameter( property = "pomFileName", defaultValue = 
"${project.file.name}" )
     private String pomFileName;
 
     /**


Reply via email to