Maven SCM
  1. Maven SCM
  2. SCM-531

Incorrect SCM URL constructed when using parent POM that is not in the parent directory

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: maven-scm-site
    • Labels:
      None
    • Environment:

      Description

      In our parent pom we have this:

        <properties>
          <scm.module>master-pom</scm.module>
        </properties>
        <scm>
          <connection>scm:cvs:ext:build@server:/srv/cvs/:${scm.module}</connection>
          <developerConnection>scm:cvs:ext:build@server:/srv/cvs/:${scm.module}</developerConnection>
          <url>http://server/fe/browse/UK-CVS-Rsync/${scm.module}</url>
        </scm>
      

      Our child pom (not in the same directory), has this:

        <artifactId>dd-util</artifactId>
        <properties>
          <scm.module>util</scm.module>
        </properties>
      

      Of course, the child pom is overriding the property. Well, it sort of works.
      When building the site of the parent pom, we get:

      http://server/fe/browse/UK-CVS-Rsync/master-pom
      

      ... which is correct. But when building the site for the child pom, we get:

      http://server/fe/browse/UK-CVS-Rsync/util/dd-util
      

      I'm quite confused as to why it whould be appending the artifactId of the child project. The property is getting replaced ok, but the the extra bit? This has got to be a bug.

      I'm not releasing the project, just building the site.

      Any ideas? If this is against the wrong project, can it be moved?

        Activity

        Hide
        João Rafael Nicola added a comment -

        I am also experiencing a similar effect.

        My parent pom has, for example:

        <developerConnection>scm:svn:https://svnserver/myprojects/$

        {project.artifactId}

        /trunk</developerConnection>

        When running "mvn help:effective-pom" on the child, whose artifactId is, for example, child-project, I get:

        <developerConnection>scm:svn:https://svnserver/myprojects/child-project/trunk/child-project</developerConnection>

        instead of the expected:

        <developerConnection>scm:svn:https://svnserver/myprojects/child-project/trunk</developerConnection>

        For some reason, the developerConnection property gets appended with the artifactId when inherited. Although this makes sense when dealing with a multi-module project which is versioned in a single project structure in subversion, it does not when the parent pom is used just to standardize some properties on the pom, which each child project independently versioned.

        I think there should be some way to disable this behaviour.

        João Nicola

        Show
        João Rafael Nicola added a comment - I am also experiencing a similar effect. My parent pom has, for example: <developerConnection>scm:svn: https://svnserver/myprojects/$ {project.artifactId} /trunk</developerConnection> When running "mvn help:effective-pom" on the child, whose artifactId is, for example, child-project, I get: <developerConnection>scm:svn: https://svnserver/myprojects/child-project/trunk/child-project </developerConnection> instead of the expected: <developerConnection>scm:svn: https://svnserver/myprojects/child-project/trunk </developerConnection> For some reason, the developerConnection property gets appended with the artifactId when inherited. Although this makes sense when dealing with a multi-module project which is versioned in a single project structure in subversion, it does not when the parent pom is used just to standardize some properties on the pom, which each child project independently versioned. I think there should be some way to disable this behaviour. João Nicola
        Hide
        Tomas Varaneckas added a comment -

        An ugly workaround for that is to have links ending with # or ?foo=, so finally they work even with /artifact-id in the end. I.e.:

        <scm>
        <connection>scm:git:git://git.xxx.com/$

        {xxx.project.path}.git?proj=</connection>
        <developerConnection>scm:git:git://gitosis@git.xxx.com/${xxx.project.path}

        .git?proj=</developerConnection>
        <url>http://git.xxx.com/?p=$

        {xxx.project.path}

        .git;a=summary#</url>
        </scm>

        Show
        Tomas Varaneckas added a comment - An ugly workaround for that is to have links ending with # or ?foo=, so finally they work even with /artifact-id in the end. I.e.: <scm> <connection>scm:git:git://git.xxx.com/$ {xxx.project.path}.git?proj=</connection> <developerConnection>scm:git:git://gitosis@git.xxx.com/${xxx.project.path} .git?proj=</developerConnection> <url> http://git.xxx.com/?p=$ {xxx.project.path} .git;a=summary#</url> </scm>
        Hide
        Youri Bonnaffé added a comment -

        I experienced the same behavior as Joao.

        Show
        Youri Bonnaffé added a comment - I experienced the same behavior as Joao.
        Hide
        Adrian Moerchen added a comment - - edited

        This is still an issue in Maven 3.0.5

        Show
        Adrian Moerchen added a comment - - edited This is still an issue in Maven 3.0.5
        Hide
        Laurent TOURREAU added a comment -

        This issue has also been detected in Maven 3.1.1

        Show
        Laurent TOURREAU added a comment - This issue has also been detected in Maven 3.1.1
        Hide
        Rami Ojares added a comment -

        Still there in version 3.3.3
        The point is that inheritance does not work here correctly when using properties.
        Try putting <scm><developerConnection>$

        {project.artifactId}

        </developerConnection></scm>
        in parent pom and see what the effective pom says in the child project.
        Shows something wrong, that's for sure.

        Is anybody listening?
        This was reported 2010 but is still not assigned.

        Show
        Rami Ojares added a comment - Still there in version 3.3.3 The point is that inheritance does not work here correctly when using properties. Try putting <scm><developerConnection>$ {project.artifactId} </developerConnection></scm> in parent pom and see what the effective pom says in the child project. Shows something wrong, that's for sure. Is anybody listening? This was reported 2010 but is still not assigned.
        Hide
        Eduardo Hernández Guerra added a comment -

        I would also like this to be fixed or at least any workaround (the ugly one proposed above by Tomas does not work with SVN).

        Any way of disabling the automatic appending of the artifactId to the inherited scm connection strings?

        Show
        Eduardo Hernández Guerra added a comment - I would also like this to be fixed or at least any workaround (the ugly one proposed above by Tomas does not work with SVN). Any way of disabling the automatic appending of the artifactId to the inherited scm connection strings?

          People

          • Assignee:
            Unassigned
            Reporter:
            Darren Bell
          • Votes:
            16 Vote for this issue
            Watchers:
            12 Start watching this issue

            Dates

            • Created:
              Updated:

              Development