Uploaded image for project: 'Maven SCM'
  1. Maven SCM
  2. SCM-379

SCM URL with query transformed incorrectly on release:prepare

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0
    • 1.1
    • maven-scm-provider-svn
    • None
    • Patch

    Description

      Given the following scm definition:

      <scm>
      <connection>scm:svn:https://myserver/svn/myproj/pom/trunk</connection>
      <developerConnection>scm:svn:https://myserver/svn/myproj/pom/trunk</developerConnection>
      <url>https://myserver/plugins/scmsvn/viewcvs.php/pom/trunk?root=myproj</url>
      </scm>

      Running the release:prepare goal transforms this to the following (in the POM associated to the tag):

      <scm>
      <connection>scm:svn:https://myserver/svn/myproj/pom/tags/mytag-1</connection>
      <developerConnection>scm:svn:https://myserver/svn/myproj/pom/tags/mytag-1</developerConnection>
      <url>https://myserver/plugins/scmsvn/viewcvs.php/pom/trunk?root=myproj/tags/mytag-1?root=myproj</url>
      </scm>

      The <url> element is incorrect, as it is adding the query "?root=myproj" twice. The desired url tag is:

      <url>https://myserver/plugins/scmsvn/viewcvs.php/pom/tags/mytag-1?root=myproj</url>

      The problem is in the class org.apache.maven.scm.provider.svn.SvnTagBranchUtils (in artifact org.apache.maven.scm:maven-scm-providers-svn). The method resolveUrl is considering the case where the URL contains a query string, but is not removing the query part of the URL before transforming it. The attached java file contains the patched version of this class that I have tested.

      Attachments

        1. SvnTagBranchUtils.java
          11 kB
          Doron Solomon

        Activity

          People

            siveton Siveton Vincent
            freeky_d Doron Solomon
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: