Nick Burch created MRELEASE-942:
-----------------------------------

             Summary: scm.url in release.properties incorrectly has project 
name appended if not defined in the top level pom
                 Key: MRELEASE-942
                 URL: https://issues.apache.org/jira/browse/MRELEASE-942
             Project: Maven Release Plugin
          Issue Type: Bug
          Components: scm
    Affects Versions: 2.5.3
            Reporter: Nick Burch


This one has stumped me for a while, and I believe it's incorrect behaviour. 
The project I'm see it on is https://github.com/Gagravarr/VorbisJava

My project structure is:
  pom.xml -> depends on parent, defines modules
  parent/pom.xml -> defines plugins, and defines scm details

When pom.xml has no scm details in it, and you do a "mvn release:prepare", the 
release.properties file will be created with the following scm-related entries:

{code}
project.scm.org.gagravarr\:vorbis-java-parent.developerConnection=scm\:git\:https\://gagrav...@github.com/Gagravarr/VorbisJava.git
project.scm.org.gagravarr\:vorbis-java-parent.url=https\://github.com/Gagravarr/VorbisJava
project.scm.org.gagravarr\:vorbis-java.connection=scm\:git\:https\://github.com/Gagravarr/VorbisJava
project.scm.org.gagravarr\:vorbis-java-parent.connection=scm\:git\:g...@github.com\:Gagravarr/VorbisJava.git
scm.url=scm\:git\:https\://gagrav...@github.com/Gagravarr/VorbisJava.git/vorbis-java
{code}

The key issue there is that the overall project name {{vorbis-java}} has been 
appended to the {{scm.url}} (only), which makes it no longer be the valid URL, 
so the prepare fails as it can't push the tag

If I duplicate the scm details in both the root pom and the parent pom, then 
the release.properties is generated as expected:
{code}
project.scm.org.gagravarr\:vorbis-java-parent.developerConnection=scm\:git\:https\://gagrav...@github.com/Gagravarr/VorbisJava.git
project.scm.org.gagravarr\:vorbis-java-parent.url=https\://github.com/Gagravarr/VorbisJava
project.scm.org.gagravarr\:vorbis-java.connection=scm\:git\:https\://github.com/Gagravarr/VorbisJava
project.scm.org.gagravarr\:vorbis-java.developerConnection=scm\:git\:https\://gagrav...@github.com/Gagravarr/VorbisJava.git
project.scm.org.gagravarr\:vorbis-java-parent.connection=scm\:git\:g...@github.com\:Gagravarr/VorbisJava.git
scm.url=scm\:git\:https\://gagrav...@github.com/Gagravarr/VorbisJava.git
{code}

In this second case, the project name is correctly missing from {{scm.url}} and 
so is valid, so the prepare works

All the projects are in the same git repo, and all projects extend from the 
parent, so that seems to me to be the right place to define the scm details. 
However, doing so causes Maven to incorrectly go and suffix the valid git URL 
with the project name, breaking things. Note that only the {{scm.url}} is 
generated incorrectly in this case, the {{project.scm.*}} ones are correct



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to