translateUrlPath works incorrectly
----------------------------------

                 Key: MRELEASE-693
                 URL: https://jira.codehaus.org/browse/MRELEASE-693
             Project: Maven 2.x Release Plugin
          Issue Type: Bug
          Components: prepare, scm
    Affects Versions: 2.2, 2.1
            Reporter: Maxim Frolov


Given the following pom.xml before release:prepare
{code:title=pom.xml|borderStyle=solid}
    <scm>
        
<url>https://localhost/svn/elo_na/Entwicklungswerkzeuge/cdi-runner/Produkt/Entwicklung/</url>
        
<developerConnection>scm:svn:https://localhost/svn/elo_na/Entwicklungswerkzeuge/cdi-runner/Produkt/Entwicklung/</developerConnection>
    </scm>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    
<tagBase>https://localhost/svn/elo_na/Entwicklungswerkzeuge/cdi-runner/Produkt/Archiv/</tagBase>
                </configuration>
            </plugin>
        </plugins>
    </build>

{code}

the scm/url in pom.xml.tag is computed wrong. 
Expected:
<url>https://localhost/svn/elo_na/Entwicklungswerkzeuge/cdi-runner/Produkt/Archiv/cdi-runner-1.2</url>

but pom.xml.tag was after release:prepare:

{code:title=pom.xml.tag|borderStyle=solid}
    <scm>
        
<url>https://localhost/svn/elo_na/Archivswerkzeuge/cdi-runner/Produkt/Archiv/cdi-runner-1.2-SNAPSHOT</url>
        
<developerConnection>scm:svn:https://localhost/svn/elo_na/Entwicklungswerkzeuge/cdi-runner/Produkt/Archiv/cdi-runner-1.2-SNAPSHOT</developerConnection>
    </scm>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    
<tagBase>https://localhost/svn/elo_na/Entwicklungswerkzeuge/cdi-runner/Produkt/Archiv/</tagBase>
                </configuration>
            </plugin>
        </plugins>
    </build>

{code}

After debugging the release plugin I found the place in the source code of 
release plugin which incorrectly translates the tagBase to url in pom.xml.tag: 
{code:title=RewritePomsForReleasePhase.java:278 in method 
translateUrlPath()|borderStyle=solid}
return StringUtils.replace( urlPath, trunkPath.substring( i ), 
tagPath.substring( i ) );
{code}
After the common path between trunk und tag urls is correctly computed, the 
StringUtils.replaces the wrong occurence of trunkPath.substring in urlPath, 
because the urlPath in this case contains more than one trunkPath.substring: 
*Entwicklungswerkzeuge* and *Entwicklung*.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to