Author: rfscholte
Date: Tue Apr 16 20:24:33 2013
New Revision: 1468598

URL: http://svn.apache.org/r1468598
Log:
[MRELEASE-832] When performing a release, username and password parameters are 
ignored. 

Added:
    
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-832/
    
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-832/invoker.properties
    
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-832/pom.xml
    
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-832/verify.groovy
Modified:
    
maven/release/trunk/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/PerformReleaseMojo.java

Added: 
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-832/invoker.properties
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-832/invoker.properties?rev=1468598&view=auto
==============================================================================
--- 
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-832/invoker.properties
 (added)
+++ 
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-832/invoker.properties
 Tue Apr 16 20:24:33 2013
@@ -0,0 +1 @@
+invoker.goals = release:clean release:perform
\ No newline at end of file

Added: 
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-832/pom.xml
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-832/pom.xml?rev=1468598&view=auto
==============================================================================
--- 
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-832/pom.xml
 (added)
+++ 
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-832/pom.xml
 Tue Apr 16 20:24:33 2013
@@ -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-832</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <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>
+        <configuration>
+          <connectionUrl>scm:dummy|nul</connectionUrl>
+          <username>perform_username</username>
+          <password>perform_password</password>
+        </configuration>
+      </plugin>
+    </plugins>
+  </build>
+</project>
\ No newline at end of file

Added: 
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-832/verify.groovy
URL: 
http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-832/verify.groovy?rev=1468598&view=auto
==============================================================================
--- 
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-832/verify.groovy
 (added)
+++ 
maven/release/trunk/maven-release-plugin/src/it/projects/perform/MRELEASE-832/verify.groovy
 Tue Apr 16 20:24:33 2013
@@ -0,0 +1,25 @@
+/*
+ * 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 buildLog.text.contains( "[DEBUG]   (f) username = perform_username" )
+assert buildLog.text.contains( "[DEBUG]   (f) password = perform_password" )
+

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=1468598&r1=1468597&r2=1468598&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 Apr 16 20:24:33 2013
@@ -85,6 +85,18 @@ public class PerformReleaseMojo
     private boolean localCheckout;
     
     /**
+     * The SCM username to use.
+     */
+    @Parameter( property = "username" )
+    private String username;
+
+    /**
+     * The SCM password to use.
+     */
+    @Parameter( property = "password" )
+    private String password;
+    
+    /**
      * 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.
@@ -128,6 +140,17 @@ public class PerformReleaseMojo
             {
                 releaseDescriptor.setScmSourceUrl( connectionUrl );
             }
+            
+            if ( username != null )
+            {
+                releaseDescriptor.setScmUsername( username );
+            }
+            
+            if( password != null )
+            {
+                releaseDescriptor.setScmPassword( password );
+            }
+            
             releaseDescriptor.setLocalCheckout( localCheckout );
 
             releaseDescriptor.setCheckoutDirectory( 
workingDirectory.getAbsolutePath() );


Reply via email to