Author: jdcasey
Date: Tue Sep 20 14:47:10 2005
New Revision: 290572

URL: http://svn.apache.org/viewcvs?rev=290572&view=rev
Log:
Resolving: MNG-842

Modified:
    maven/components/trunk/maven-core-it/it2002/project/pom.xml
    
maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectScmRewriter.java

Modified: maven/components/trunk/maven-core-it/it2002/project/pom.xml
URL: 
http://svn.apache.org/viewcvs/maven/components/trunk/maven-core-it/it2002/project/pom.xml?rev=290572&r1=290571&r2=290572&view=diff
==============================================================================
--- maven/components/trunk/maven-core-it/it2002/project/pom.xml (original)
+++ maven/components/trunk/maven-core-it/it2002/project/pom.xml Tue Sep 20 
14:47:10 2005
@@ -40,14 +40,14 @@
   </distributionManagement>
 
   <scm>
-    
<connection>scm:svn:file://localhost/${project.file.parentFile.parentFile}/target/svnroot/project/trunk</connection>
-    
<developerConnection>scm:svn:file://localhost/${project.file.parentFile.parentFile}/target/svnroot/project/trunk</developerConnection>
-    
<url>file://localhost/${project.file.parentFile.parentFile}/target/svnroot/project/trunk</url>
+    
<connection>scm:svn:file://localhost/${project.file.parentFile.parentFile}/target/svnroot/trunk/project</connection>
+    
<developerConnection>scm:svn:file://localhost/${project.file.parentFile.parentFile}/target/svnroot/trunk/project</developerConnection>
+    
<url>file://localhost/${project.file.parentFile.parentFile}/target/svnroot/trunk/project</url>
     <tag>p1</tag>
   </scm>
 
   <properties>
-    
<tagBase>file://localhost/${project.file.parentFile.parentFile}/target/svnroot/project/tags</tagBase>
+    
<tagBase>file://localhost/${project.file.parentFile.parentFile}/target/svnroot/tags</tagBase>
   </properties>
 
   <build>

Modified: 
maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectScmRewriter.java
URL: 
http://svn.apache.org/viewcvs/maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectScmRewriter.java?rev=290572&r1=290571&r2=290572&view=diff
==============================================================================
--- 
maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectScmRewriter.java
 (original)
+++ 
maven/components/trunk/maven-plugins/maven-release-plugin/src/main/java/org/apache/maven/plugins/release/helpers/ProjectScmRewriter.java
 Tue Sep 20 14:47:10 2005
@@ -23,6 +23,9 @@
 import org.apache.maven.project.MavenProject;
 import org.codehaus.plexus.util.StringUtils;
 
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
 public class ProjectScmRewriter
 {
     private ReleaseProgressTracker releaseProgress;
@@ -87,9 +90,23 @@
 
     private String convertSvnConnectionString( String scmConnection, String 
tag )
     {
-        if ( scmConnection.indexOf( "/trunk" ) >= 0 )
+        int trunkBegin = scmConnection.indexOf( "/trunk" );
+        
+        if ( trunkBegin >= 0 )
         {
-            scmConnection = StringUtils.replace( scmConnection, "/trunk", 
"/tags/" + tag );
+            String tail = "";
+            
+            if ( scmConnection.length() > trunkBegin + "/trunk".length() )
+            {
+                tail = scmConnection.substring( trunkBegin + "/trunk".length() 
);
+                
+                if ( !tail.startsWith( "/" ) )
+                {
+                    tail += "/";
+                }
+            }
+            
+            scmConnection = scmConnection.substring( 0, trunkBegin ) + 
"/tags/" + tag + tail;
         }
         else
         {



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to