[ 
https://jira.codehaus.org/browse/MRELEASE-767?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=300341#comment-300341
 ] 

Jeremy Norris commented on MRELEASE-767:
----------------------------------------

The workaround I am using for now (although a more proper fix is needed wrt the 
maven scm API and the release manager):

--- a/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java
+++ b/src/main/java/org/apache/maven/shared/release/util/ReleaseUtil.java
@@ -179,7 +179,12 @@ public class ReleaseUtil
         FileUtils.normalize( releaseDescriptor.getWorkingDirectory() ) );
 
         String url = releaseDescriptor.getScmSourceUrl();
-        url = realignScmUrl( parentLevels, url );
+        if (!url.matches("scm:git.*")) {
+          String urlOrig = url;
+          url = realignScmUrl( parentLevels, url );
+          // No logger available:
+          System.out.println("SCM source URL realignment: " + urlOrig + " => " 
+ url);
+        }
 
         ReleaseDescriptor descriptor = new ReleaseDescriptor();
         descriptor.setWorkingDirectory( basedir );

                
> releasing flat multi-module projects using git
> ----------------------------------------------
>
>                 Key: MRELEASE-767
>                 URL: https://jira.codehaus.org/browse/MRELEASE-767
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>    Affects Versions: 2.3.1
>         Environment: Apache Maven 3.0.3 (r1075438; 2011-02-28 09:31:09-0800)
> Maven home: /usr/share/maven
> Java version: 1.6.0_31, vendor: Apple Inc.
> Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
> Default locale: en_US, platform encoding: MacRoman
> OS name: "mac os x", version: "10.7.4", arch: "x86_64", family: "mac"
>            Reporter: Jeremy Norris
>
> When releasing a project as follows:
> ./parent/pom.xml
> ./module-a/pom.xml
> ./module-b/pom.xml
> From the parent directory, with an scm config in the parent pom.xml (only) as 
> follows:
> <scm>
>   <connection>scm:git:ssh://github.com/repox.git</connection>
>   
> <developerConnection>scm:git:ssh://github.com/repox.git</developerConnection>
>   <tag>master</tag>
>   <url>https://github.com/view/repox.git</url>
> </scm>
> In org/apache/maven/shared/release/util/ReleaseUtils.java:182 it does this 
> indiscriminately:
> url = realignScmUrl( parentLevels, url );
> This will trim the repo url from 'ssh://github.com/repox.git' -> 
> 'ssh://github.com', which will cause a failure when pushing the tag.
> This type of realignment is not appropriate when using a git scm type.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to