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 2015/04/04 17:43:56 UTC

svn commit: r1671275 - in /maven/release/trunk: maven-release-manager/src/main/ maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ maven-release-plugin/src/it/projects/update-versions/MRELEASE-611/

Author: rfscholte
Date: Sat Apr  4 15:43:55 2015
New Revision: 1671275

URL: http://svn.apache.org/r1671275
Log:
[MRELEASE-611] The update-versions goal fails when project is not at a SNAPSHOT version

Added:
    maven/release/trunk/maven-release-plugin/src/it/projects/update-versions/MRELEASE-611/
    maven/release/trunk/maven-release-plugin/src/it/projects/update-versions/MRELEASE-611/pom.xml
    maven/release/trunk/maven-release-plugin/src/it/projects/update-versions/MRELEASE-611/verify.groovy
Modified:
    maven/release/trunk/maven-release-manager/src/main/components-fragment.xml
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckPomPhase.java

Modified: maven/release/trunk/maven-release-manager/src/main/components-fragment.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/components-fragment.xml?rev=1671275&r1=1671274&r2=1671275&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/components-fragment.xml (original)
+++ maven/release/trunk/maven-release-manager/src/main/components-fragment.xml Sat Apr  4 15:43:55 2015
@@ -267,6 +267,7 @@
       <implementation>org.apache.maven.shared.release.phase.CheckPomPhase</implementation>
       <configuration>
         <scmRequired>true</scmRequired>
+        <snapshotsRequired>true</snapshotsRequired>
       </configuration>
       <requirements>
         <requirement>
@@ -280,6 +281,7 @@
       <implementation>org.apache.maven.shared.release.phase.CheckPomPhase</implementation>
       <configuration>
         <scmRequired>false</scmRequired>
+        <snapshotsRequired>false</snapshotsRequired>
       </configuration>
       <requirements>
         <requirement>

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckPomPhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckPomPhase.java?rev=1671275&r1=1671274&r2=1671275&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckPomPhase.java (original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckPomPhase.java Sat Apr  4 15:43:55 2015
@@ -49,6 +49,11 @@ public class CheckPomPhase
      */
     private boolean scmRequired = true;
     
+    /**
+     * @since 2.5.2
+     */
+    private boolean snapshotsRequired = true;
+
     private ScmRepositoryConfigurator scmRepositoryConfigurator;
 
     public ReleaseResult execute( ReleaseDescriptor releaseDescriptor, ReleaseEnvironment releaseEnvironment,
@@ -105,10 +110,12 @@ public class CheckPomPhase
             if ( ArtifactUtils.isSnapshot( project.getVersion() ) )
             {
                 containsSnapshotProjects = true;
+
+                break;
             }
         }
 
-        if ( !containsSnapshotProjects && !releaseDescriptor.isBranchCreation() )
+        if ( snapshotsRequired && !containsSnapshotProjects && !releaseDescriptor.isBranchCreation() )
         {
             throw new ReleaseFailureException( "You don't have a SNAPSHOT project in the reactor projects list." );
         }

Added: maven/release/trunk/maven-release-plugin/src/it/projects/update-versions/MRELEASE-611/pom.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/update-versions/MRELEASE-611/pom.xml?rev=1671275&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/update-versions/MRELEASE-611/pom.xml (added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/update-versions/MRELEASE-611/pom.xml Sat Apr  4 15:43:55 2015
@@ -0,0 +1,41 @@
+<?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.its.release</groupId>
+  <artifactId>mrelease-661</artifactId>
+  <version>1.0</version>
+  <packaging>pom</packaging>
+
+  <url>http://jira.codehaus.org/browse/MRELEASE-611</url>
+  
+  <description>Ensure you can update from a non-SNAPSHOT project</description>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-release-plugin</artifactId>
+        <version>@project.version@</version>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: maven/release/trunk/maven-release-plugin/src/it/projects/update-versions/MRELEASE-611/verify.groovy
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/update-versions/MRELEASE-611/verify.groovy?rev=1671275&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/update-versions/MRELEASE-611/verify.groovy (added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/update-versions/MRELEASE-611/verify.groovy Sat Apr  4 15:43:55 2015
@@ -0,0 +1,28 @@
+
+/*
+ * 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()
+
+def projectRoot = new XmlSlurper().parse( new File( basedir, pom.xml" ) )
+
+assert projectRoot.version.text() == "1.1-SNAPSHOT"  
+
+return true
\ No newline at end of file