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

URL mangling should preserve double slashes

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 1.4
    • None
    • None
    • Apache Maven 3.0 (r1004208; 2010-10-04 13:50:56+0200)
      Java version: 1.6.0_20

    Description

      AFAIK, Mercurial allows for URLs like ssh://example.org//home/sewe/example-project/. Unfortunately, the Mercurial SCM provider turns this into hg push ssh://example.org/home/sewe/example-project/, which fails if, e.g., the Mercurial server is configured to look for repositories in the user's home directory (may or may not be /home/sewe, depending on your login) unless an absolute path is explicitly requested by using a path starting with a double slash.

      Attachments

        Issue Links

          Activity

            fredrikj Fredrik Jonson added a comment -

            The bug is in the DefaultUrlNormalizer class in the module maven-model-builder, that is a part of maven-core, not maven-scm-plugin or the scm hg provider.

            The DefaultUrlNormalizer does the following to the element scm/connection:

            result = result.replaceAll( "(?<![:/])/+", "/" );

            Which removes any double slash after the hostname part of a url.

            The normalization occurs when the release plugin doesn't find a ScmSourceUrl in the plugin descriptor. Instead MavenProject.getScm().getConnection() is used to retrieve a scm url. When that method returns the scm connection url is "normalized" and that all so important double slash is removed.

            See discussion here: http://news.gmane.org/gmane.comp.jakarta.turbine.maven.devel/98099

            fredrikj Fredrik Jonson added a comment - The bug is in the DefaultUrlNormalizer class in the module maven-model-builder, that is a part of maven-core, not maven-scm-plugin or the scm hg provider. The DefaultUrlNormalizer does the following to the element scm/connection: result = result.replaceAll( "(?<! [:/] )/+", "/" ); Which removes any double slash after the hostname part of a url. The normalization occurs when the release plugin doesn't find a ScmSourceUrl in the plugin descriptor. Instead MavenProject.getScm().getConnection() is used to retrieve a scm url. When that method returns the scm connection url is "normalized" and that all so important double slash is removed. See discussion here: http://news.gmane.org/gmane.comp.jakarta.turbine.maven.devel/98099

            People

              bentmann Benjamin Bentmann
              sewe Andreas Sewe
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: