You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "Elliotte Rusty Harold (Jira)" <ji...@apache.org> on 2019/12/22 12:02:00 UTC

[jira] [Updated] (MRELEASE-942) scm.url in release.properties incorrectly has project name appended if not defined in the top level pom

     [ https://issues.apache.org/jira/browse/MRELEASE-942?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Elliotte Rusty Harold updated MRELEASE-942:
-------------------------------------------
    Description: 
This one 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\://gagravarr@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\:git@github.com\:Gagravarr/VorbisJava.git
scm.url=scm\:git\:https\://gagravarr@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 a 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\://gagravarr@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\://gagravarr@github.com/Gagravarr/VorbisJava.git
project.scm.org.gagravarr\:vorbis-java-parent.connection=scm\:git\:git@github.com\:Gagravarr/VorbisJava.git
scm.url=scm\:git\:https\://gagravarr@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

  was:
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\://gagravarr@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\:git@github.com\:Gagravarr/VorbisJava.git
scm.url=scm\:git\:https\://gagravarr@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\://gagravarr@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\://gagravarr@github.com/Gagravarr/VorbisJava.git
project.scm.org.gagravarr\:vorbis-java-parent.connection=scm\:git\:git@github.com\:Gagravarr/VorbisJava.git
scm.url=scm\:git\:https\://gagravarr@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


> 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
>            Priority: Major
>
> This one 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\://gagravarr@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\:git@github.com\:Gagravarr/VorbisJava.git
> scm.url=scm\:git\:https\://gagravarr@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 a 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\://gagravarr@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\://gagravarr@github.com/Gagravarr/VorbisJava.git
> project.scm.org.gagravarr\:vorbis-java-parent.connection=scm\:git\:git@github.com\:Gagravarr/VorbisJava.git
> scm.url=scm\:git\:https\://gagravarr@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
(v8.3.4#803005)