You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Michael Wenig (JIRA)" <ji...@codehaus.org> on 2009/10/29 18:27:28 UTC

[jira] Issue Comment Edited: (MRELEASE-128) SCM properties being replaced during release:perform

    [ http://jira.codehaus.org/browse/MRELEASE-128?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=196553#action_196553 ] 

Michael Wenig edited comment on MRELEASE-128 at 10/29/09 12:26 PM:
-------------------------------------------------------------------

As we are currently moving some projects from cvs to subversion I recognized that the patch 
MRELEASE-128_cvs_hack_RewritePomsForDevelopmentPhase.java.patch 

is only valid for CVS. When using svn the patch may not be used as otherwise the poms left in the trunk/branch will then include the tagname. So I did put around two ifs in RewritePomsForDevelopmentPhase, checking if it is scm:cvs:
{noformat}
                     if ( scm != null )
                     {
                    	String connection = scm.getConnection();
                    	String developerConnection = scm.getDeveloperConnection();
                    	if ((connection != null) && (connection.startsWith("scm:cvs:"))) {
	                    	//MRELEASE-128
                    		String oldConnection = connection;
	                        connection = ( scmRoot.getChildText("connection", namespace) != null )
									? scmRoot.getChildText("connection", namespace)
									: scm.getConnection();
				getLogger().info("applying Patch MRELEASE-128 to connection, replacing " + oldConnection + " with " + connection);
                    	}
                    	if ((developerConnection != null) && (developerConnection.startsWith("scm:cvs:"))) {
	                    	//MRELEASE-128
                    		String oldConnection = developerConnection;
				developerConnection = ( scmRoot.getChildText("developerConnection", namespace) != null )
									? scmRoot.getChildText("developerConnection", namespace)
									: scm.getDeveloperConnection();
				getLogger().info("applying Patch MRELEASE-128 to developerConnection, replacing " + oldConnection + " with " + connection);
                    	}
                        rewriteElement( "connection", connection, scmRoot, namespace );
                        rewriteElement( "developerConnection", developerConnection, scmRoot, namespace );
                        rewriteElement( "url", scm.getUrl(), scmRoot, namespace );
                        rewriteElement( "tag", translator.resolveTag( scm.getTag() ), scmRoot, namespace );
{noformat} 
(sorry - I am currently not able to create a patch-file for this as we have reversioned the source in our corporate system and it would not be applyable to the 'official' branch). It should be (after applying the patch mentioned above in src/main/java/org/apache/maven/shared/release/phase/RewritePomsForDevelopmentPhase.java
around line 72

now it seems to work with both cvs and svn.

When I am at home I will try to apply this to a 'fresh' checkout from the branch and create a real patch-file

Edit: formatting

      was (Author: micha123):
    As we are currently moving some projects from cvs to subversion I recognized that the patch 
MRELEASE-128_cvs_hack_RewritePomsForDevelopmentPhase.java.patch 

is only valid for CVS. When using svn the patch may not be used as otherwise the poms left in the trunk/branch will then include the tagname. So I did put around two ifs in RewritePomsForDevelopmentPhase, checking if it is scm:cvs:

                     if ( scm != null )
                     {
                    	String connection = scm.getConnection();
                    	String developerConnection = scm.getDeveloperConnection();
                    	if ((connection != null) && (connection.startsWith("scm:cvs:"))) {
	                    	//MRELEASE-128
                    		String oldConnection = connection;
	                        connection = ( scmRoot.getChildText("connection", namespace) != null )
									? scmRoot.getChildText("connection", namespace)
									: scm.getConnection();
				getLogger().info("applying Patch MRELEASE-128 to connection, replacing " + oldConnection + " with " + connection);
                    	}
                    	if ((developerConnection != null) && (developerConnection.startsWith("scm:cvs:"))) {
	                    	//MRELEASE-128
                    		String oldConnection = developerConnection;
				developerConnection = ( scmRoot.getChildText("developerConnection", namespace) != null )
									? scmRoot.getChildText("developerConnection", namespace)
									: scm.getDeveloperConnection();
				getLogger().info("applying Patch MRELEASE-128 to developerConnection, replacing " + oldConnection + " with " + connection);
                    	}
                        rewriteElement( "connection", connection, scmRoot, namespace );
                        rewriteElement( "developerConnection", developerConnection, scmRoot, namespace );
                        rewriteElement( "url", scm.getUrl(), scmRoot, namespace );
                        rewriteElement( "tag", translator.resolveTag( scm.getTag() ), scmRoot, namespace );

(sorry - I am currently not able to create a patch-file for this as we have reversioned the source in our corporate system and it would not be applyable to the 'official' branch). It should be (after applying the patch mentioned above in src/main/java/org/apache/maven/shared/release/phase/RewritePomsForDevelopmentPhase.java
around line 72

now it seems to work with both cvs and svn.

When I am at home I will try to apply this to a 'fresh' checkout from the branch and create a real patch-file
  
> SCM properties being replaced during release:perform
> ----------------------------------------------------
>
>                 Key: MRELEASE-128
>                 URL: http://jira.codehaus.org/browse/MRELEASE-128
>             Project: Maven 2.x Release Plugin
>          Issue Type: Bug
>          Components: prepare
>         Environment: Windows XP client, Linux repo, CVS, Maven 2.0.4
>            Reporter: Craig Dickson
>            Assignee: Emmanuel Venisse
>            Priority: Critical
>             Fix For: 2.0
>
>         Attachments: after-release-perform-pom.xml, after-release-prepre-pom.xml, MNG-128-maven-release-manager.patch, MRELEASE-128_cvs_hack_RewritePomsForDevelopmentPhase.java.patch, original-pom.xml
>
>
> The <scm> section of a pom in CVS for a pom archetype project looks like this prior to executing release:prepare :
> <scm>
> 	<connection>${base.cvs.url}:commons-maven/uber-pom</connection>
> 	<developerConnection>${base.cvs.url}:commons-maven/uber-pom</developerConnection>
> 	<url>${base.viewcvs.url}/commons-maven/uber-pom</url>
> </scm>
> Then after executing release:prepare, the pom in CVS looks like this (new <tag> tag is only difference):
> <scm>
> 	<connection>${base.cvs.url}:commons-maven/uber-pom</connection>
> 	<developerConnection>${base.cvs.url}:commons-maven/uber-pom</developerConnection>
> 	<url>${base.viewcvs.url}/commons-maven/uber-pom</url>
> 	<tag>R-1_7</tag>
> </scm>
> Then after executing release:perform, the pom looks like this in CVS:
> <scm>
> 	<connection>scm:cvs:pserver:behrcvs.masco-coatings.com:/usr/cvsroot:commons-maven/uber-pom</connection>
> 	<developerConnection>scm:cvs:pserver:behrcvs.masco-coatings.com:/usr/cvsroot:commons-maven/uber-pom</developerConnection>
> 	<url>http://behrcvs.masco-coatings.com/cgi-bin/viewcvs.cgi/commons-maven/uber-pom</url>
> </scm>
> Notice that the properties that were there for the base URLs for CVS and ViewCVS have been replaced with literal values. 
> No other properties in the POM are being replaced

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira