maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rfscho...@apache.org
Subject svn commit: r1300335 - in /maven/release/trunk: maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/ maven-release-plugin/src/it/ maven-release-plugin/src/it/projects/prepare/MRELEASE-420/
Date Tue, 13 Mar 2012 20:27:29 GMT
Author: rfscholte
Date: Tue Mar 13 20:27:29 2012
New Revision: 1300335

URL: http://svn.apache.org/viewvc?rev=1300335&view=rev
Log:
Fix MRELEASE-420: Prepare and Perform should use profile server settings

Added:
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-420/
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-420/pom.xml
    maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-420/verify.groovy
Modified:
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhase.java
    maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhase.java
    maven/release/trunk/maven-release-plugin/src/it/settings.xml

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java?rev=1300335&r1=1300334&r2=1300335&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/AbstractRewritePomsPhase.java
Tue Mar 13 20:27:29 2012
@@ -36,6 +36,7 @@ import java.util.regex.Pattern;
 
 import org.apache.maven.artifact.ArtifactUtils;
 import org.apache.maven.model.Model;
+import org.apache.maven.model.Scm;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.scm.ScmException;
 import org.apache.maven.scm.ScmFileSet;
@@ -49,6 +50,7 @@ import org.apache.maven.shared.release.R
 import org.apache.maven.shared.release.ReleaseResult;
 import org.apache.maven.shared.release.config.ReleaseDescriptor;
 import org.apache.maven.shared.release.env.ReleaseEnvironment;
+import org.apache.maven.shared.release.scm.IdentifiedScm;
 import org.apache.maven.shared.release.scm.ReleaseScmCommandException;
 import org.apache.maven.shared.release.scm.ReleaseScmRepositoryException;
 import org.apache.maven.shared.release.scm.ScmRepositoryConfigurator;
@@ -808,4 +810,23 @@ public abstract class AbstractRewritePom
         }
         return tagElement;
     }
-}
+ 
+    protected Scm buildScm( MavenProject project )
+    {
+        IdentifiedScm scm;
+        if( project.getScm() == null )
+        {
+            scm = null;
+        }
+        else
+        {
+            scm = new IdentifiedScm();
+            scm.setConnection( project.getScm().getConnection() );
+            scm.setDeveloperConnection( project.getScm().getDeveloperConnection() );
+            scm.setTag( project.getScm().getTag() );
+            scm.setUrl( project.getScm().getUrl() );
+            scm.setId( project.getProperties().getProperty( "project.scm.id" ) );
+        }
+        return scm;
+    }
+}
\ No newline at end of file

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhase.java?rev=1300335&r1=1300334&r2=1300335&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForBranchPhase.java
Tue Mar 13 20:27:29 2012
@@ -60,7 +60,8 @@ public class RewritePomsForBranchPhase
             Element scmRoot = rootElement.getChild( "scm", namespace );
             if ( scmRoot != null )
             {
-                releaseDescriptor.mapOriginalScmInfo( projectId, project.getScm() );
+                Scm scm = buildScm( project );
+                releaseDescriptor.mapOriginalScmInfo( projectId, scm );
 
                 try
                 {

Modified: maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhase.java
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhase.java?rev=1300335&r1=1300334&r2=1300335&view=diff
==============================================================================
--- maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhase.java
(original)
+++ maven/release/trunk/maven-release-manager/src/main/java/org/apache/maven/shared/release/phase/RewritePomsForReleasePhase.java
Tue Mar 13 20:27:29 2012
@@ -60,7 +60,8 @@ public class RewritePomsForReleasePhase
             Element scmRoot = rootElement.getChild( "scm", namespace );
             if ( scmRoot != null )
             {
-                releaseDescriptor.mapOriginalScmInfo( projectId, project.getScm() );
+                Scm scm = buildScm( project );
+                releaseDescriptor.mapOriginalScmInfo( projectId, scm );
 
                 try
                 {

Added: maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-420/pom.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-420/pom.xml?rev=1300335&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-420/pom.xml
(added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-420/pom.xml
Tue Mar 13 20:27:29 2012
@@ -0,0 +1,56 @@
+<?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-420</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  
+  <description>
+    Pick up the server from the settings.xml by the project.scm.id-property
+  </description>
+
+  <scm>
+    <connection>scm:dummy|nul</connection>
+    <developerConnection>scm:dummy|nul</developerConnection>
+  </scm>
+  
+  <properties>
+    <project.scm.id>it-server</project.scm.id>
+  </properties>
+
+  <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-420/verify.groovy
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-420/verify.groovy?rev=1300335&view=auto
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-420/verify.groovy
(added)
+++ maven/release/trunk/maven-release-plugin/src/it/projects/prepare/MRELEASE-420/verify.groovy
Tue Mar 13 20:27:29 2012
@@ -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 releaseProperties = new File( basedir, 'release.properties' )
+assert releaseProperties.exists()
+
+assert 1 == buildLog.getText().count("scm.id=it-server")
+assert 1 == buildLog.getText().count("project.scm.org.apache.maven.plugin.release.its\\:mrelease-420.id=it-server")

Modified: maven/release/trunk/maven-release-plugin/src/it/settings.xml
URL: http://svn.apache.org/viewvc/maven/release/trunk/maven-release-plugin/src/it/settings.xml?rev=1300335&r1=1300334&r2=1300335&view=diff
==============================================================================
--- maven/release/trunk/maven-release-plugin/src/it/settings.xml (original)
+++ maven/release/trunk/maven-release-plugin/src/it/settings.xml Tue Mar 13 20:27:29 2012
@@ -17,7 +17,17 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
   -->
-<settings>
+<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
+  
+  <servers>
+    <server>
+      <id>it-server</id>
+      <username>it-username</username>
+      <password>it-password</password>
+    </server>
+  </servers>
+  
   <profiles>
     <profile>
       <id>it-repo</id>



Mime
View raw message