Author: rfscholte
Date: Tue Jan  8 20:20:17 2013
New Revision: 1430485

URL: http://svn.apache.org/viewvc?rev=1430485&view=rev
Log:
[MRELEASE-818] release:perform ignores localCheckout=true 

Added:
    
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-818/
    
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-818/pom.xml
    
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-818/verify.groovy
Modified:
    
maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java
    
maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractScmReleaseMojo.java
    
maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java

Modified: 
maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java?rev=1430485&r1=1430484&r2=1430485&view=diff
==============================================================================
--- 
maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java
 (original)
+++ 
maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/CheckoutProjectFromScm.java
 Tue Jan  8 20:20:17 2013
@@ -274,7 +274,14 @@ public class CheckoutProjectFromScm
     {
         ReleaseResult result = new ReleaseResult();
 
-        logInfo( result, "The project would be checked out to perform the 
release ..." );
+        if ( releaseDescriptor.isLocalCheckout() )
+        {
+            logInfo( result, "This would be a LOCAL check out to perform the 
release ..." );
+        }
+        else
+        {
+            logInfo( result, "The project would be checked out to perform the 
release ..." );
+        }
 
         result.setResultCode( ReleaseResult.SUCCESS );
         return result;

Added: 
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-818/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-818/pom.xml?rev=1430485&view=auto
==============================================================================
--- 
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-818/pom.xml
 (added)
+++ 
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-818/pom.xml
 Tue Jan  8 20:20:17 2013
@@ -0,0 +1,65 @@
+<?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-818</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>
+        <dependencies>
+          <dependency>
+            <groupId>org.apache.maven.its.release</groupId>
+            <artifactId>maven-scm-provider-dummy</artifactId>
+            <version>1.0</version>
+          </dependency>
+        </dependencies>
+        <configuration>
+          <localCheckout>true</localCheckout>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Added: 
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-818/verify.groovy
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-818/verify.groovy?rev=1430485&view=auto
==============================================================================
--- 
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-818/verify.groovy
 (added)
+++ 
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-818/verify.groovy
 Tue Jan  8 20:20:17 2013
@@ -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()
+
+def localCheckoutExpr = /\Q[INFO] This would be a LOCAL check out to perform 
the release ...\E/
+def matcher = ( buildLog.getText() =~ localCheckoutExpr )
+
+assert matcher.find()
+assert matcher.getCount() == 1
\ No newline at end of file

Modified: 
maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractScmReleaseMojo.java
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractScmReleaseMojo.java?rev=1430485&r1=1430484&r2=1430485&view=diff
==============================================================================
--- 
maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractScmReleaseMojo.java
 (original)
+++ 
maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/AbstractScmReleaseMojo.java
 Tue Jan  8 20:20:17 2013
@@ -87,18 +87,6 @@ public abstract class AbstractScmRelease
     private String scmCommentPrefix;
 
     /**
-     * Use a local checkout instead of doing a checkout from the upstream 
repository.
-     * ATTENTION: This will only work with distributed SCMs which support the 
file:// protocol
-     * like e.g. git, jgit or hg!
-     *
-     * TODO: we should think about having the defaults for the various SCM 
providers provided via modello!
-     *
-     * @since 2.0
-     */
-    @Parameter( defaultValue = "false", property = "localCheckout" )
-    private boolean localCheckout;
-    
-    /**
      * Implemented with git will or not push changes to the upstream 
repository.
      * <code>true</code> by default to preserve backward compatibility.
      * @since 2.1
@@ -151,7 +139,6 @@ public abstract class AbstractScmRelease
         descriptor.setScmUsername( username );
         descriptor.setScmCommentPrefix( scmCommentPrefix );
 
-        descriptor.setLocalCheckout( localCheckout );
         descriptor.setPushChanges( pushChanges );
 
         return descriptor;

Modified: 
maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java?rev=1430485&r1=1430484&r2=1430485&view=diff
==============================================================================
--- 
maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java
 (original)
+++ 
maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java
 Tue Jan  8 20:20:17 2013
@@ -73,6 +73,18 @@ public class PerformReleaseMojo
     private String connectionUrl;
 
     /**
+     * Use a local checkout instead of doing a checkout from the upstream 
repository.
+     * ATTENTION: This will only work with distributed SCMs which support the 
file:// protocol
+     * like e.g. git, jgit or hg!
+     *
+     * TODO: we should think about having the defaults for the various SCM 
providers provided via modello!
+     *
+     * @since 2.0
+     */
+    @Parameter( defaultValue = "false", property = "localCheckout" )
+    private boolean localCheckout;
+    
+    /**
      * Whether to use the release profile that adds sources and javadocs to 
the released artifact, if appropriate.
      * If set to true, the release plugin sets the property "performRelease" 
to true, which activates the profile
      * "release-profile", which is inherited from the super pom.
@@ -116,6 +128,7 @@ public class PerformReleaseMojo
             {
                 releaseDescriptor.setScmSourceUrl( connectionUrl );
             }
+            releaseDescriptor.setLocalCheckout( localCheckout );
 
             releaseDescriptor.setCheckoutDirectory( 
workingDirectory.getAbsolutePath() );
             releaseDescriptor.setUseReleaseProfile( useReleaseProfile );


Reply via email to