Uploaded image for project: 'Maven Release Plugin'
  1. Maven Release Plugin
  2. MRELEASE-693

translateUrlPath works incorrectly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.1, 2.2
    • Fix Version/s: None
    • Component/s: prepare, scm
    • Labels:
      None

      Description

      Given the following pom.xml before release:prepare

      pom.xml
          <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>
      
      

      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:

      pom.xml.tag
          <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>
      
      

      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:

      RewritePomsForReleasePhase.java:278 in method translateUrlPath()
      return StringUtils.replace( urlPath, trunkPath.substring( i ), tagPath.substring( i ) );
      

      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.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              wrungel Maxim Frolov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: