Resolving: MNG-842

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@290572 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
John Dennis Casey 2005-09-20 21:47:10 +00:00
parent abdfbe1c74
commit 554dd0b525
2 changed files with 23 additions and 6 deletions

View File

@ -40,14 +40,14 @@
</distributionManagement> </distributionManagement>
<scm> <scm>
<connection>scm:svn:file://localhost/${project.file.parentFile.parentFile}/target/svnroot/project/trunk</connection> <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/project/trunk</developerConnection> <developerConnection>scm:svn:file://localhost/${project.file.parentFile.parentFile}/target/svnroot/trunk/project</developerConnection>
<url>file://localhost/${project.file.parentFile.parentFile}/target/svnroot/project/trunk</url> <url>file://localhost/${project.file.parentFile.parentFile}/target/svnroot/trunk/project</url>
<tag>p1</tag> <tag>p1</tag>
</scm> </scm>
<properties> <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> </properties>
<build> <build>

View File

@ -23,6 +23,9 @@ import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.StringUtils; import org.codehaus.plexus.util.StringUtils;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class ProjectScmRewriter public class ProjectScmRewriter
{ {
private ReleaseProgressTracker releaseProgress; private ReleaseProgressTracker releaseProgress;
@ -87,9 +90,23 @@ public class ProjectScmRewriter
private String convertSvnConnectionString( String scmConnection, String tag ) 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 else
{ {