Maven Release Plugin
  1. Maven Release Plugin
  2. MRELEASE-159

Support a pattern to generate the release tag

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta-4
    • Fix Version/s: 2.2
    • Component/s: prepare
    • Labels:
      None

      Description

      The release-plugin uses currently the pattern "<artifactId>-<version>" to create the version tag. A configuration element would be fine to support different requirements for release tags (in our case "v_<version>", since with svn the module is already part of the path).

      1. MRELEASE-159-PATCH.diff.gz
        1 kB
        Dave Copeland
      2. MRELEASE-159-PATCH-update.diff.gz
        2 kB
        Dave Copeland
      3. release-manager-patch.patch
        5 kB
        Jeff Skjonsby
      4. release-manager(updated).patch
        17 kB
        Jeff Skjonsby
      5. MRELEASE-159-PATCH-2-0.patch
        11 kB
        micha123

        Issue Links

          Activity

          Hide
          Sergio Fernandes added a comment -

          I have the same problem: I need to add a suffix to make the release tag match our naming pattern.

          Adding variables as suggested in http://jira.codehaus.org/browse/MRELEASE-150 seems to be very easy and valuable.

          Show
          Sergio Fernandes added a comment - I have the same problem: I need to add a suffix to make the release tag match our naming pattern. Adding variables as suggested in http://jira.codehaus.org/browse/MRELEASE-150 seems to be very easy and valuable.
          Hide
          Wim Deblauwe added a comment -

          We have a pattern of RLS_<artifactId>_<version> where everything is uppercase. I would be very happy if you could add support for changing case also.

          Show
          Wim Deblauwe added a comment - We have a pattern of RLS_<artifactId>_<version> where everything is uppercase. I would be very happy if you could add support for changing case also.
          Hide
          Dave Copeland added a comment -

          Here is a patch that provides this feature. I, too, need it, as the default is redundant for our environment.

          This adds the configuration option tagNameFormat that takes a Java MessageFormat string, where

          {0} is the artifact name and {1} is the version (as such, the default is {0}

          -

          {1}

          ; what it is currently).

          Tests should be included to cover this. I really need this feature, so committers feel free to contact me for any changes you'd like to see.

          Show
          Dave Copeland added a comment - Here is a patch that provides this feature. I, too, need it, as the default is redundant for our environment. This adds the configuration option tagNameFormat that takes a Java MessageFormat string, where {0} is the artifact name and {1} is the version (as such, the default is {0} - {1} ; what it is currently). Tests should be included to cover this. I really need this feature, so committers feel free to contact me for any changes you'd like to see.
          Hide
          Dave Copeland added a comment - - edited

          Apologies; the previous patch is not sufficient; I underestimated the breadth of the configuration. This patch should work.

          Show
          Dave Copeland added a comment - - edited Apologies; the previous patch is not sufficient; I underestimated the breadth of the configuration. This patch should work.
          Hide
          Mark Hobson added a comment -

          It would be good to reuse the format pattern syntax used by maven-eclipse-plugin and m2eclipse:
          http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html#projectNameTemplate

          Show
          Mark Hobson added a comment - It would be good to reuse the format pattern syntax used by maven-eclipse-plugin and m2eclipse: http://maven.apache.org/plugins/maven-eclipse-plugin/eclipse-mojo.html#projectNameTemplate
          Hide
          Michael Wenig added a comment -

          is it possible to integrate this patch in the version 2.0-beta-10 and release it?

          It's a bit urgent at my current customer...

          Thanks Michael

          Show
          Michael Wenig added a comment - is it possible to integrate this patch in the version 2.0-beta-10 and release it? It's a bit urgent at my current customer... Thanks Michael
          Hide
          Dave Copeland added a comment - - edited

          Michael - if you are desperate and don't want to wait, you can use it now with a bit of elbow grease (this is what we're doing where I work):

          1. checkout the 2.0-beta-9 via https://svn.apache.org/repos/asf/maven/release/tags/maven-release-2.0-beta-9 (you need both the release manager and the release plugin, which this url will get you)
          2. apply the patch (the latest of the two; I don't have perms to delete the bad one)
          3. Change the groupId and version in all three poms (this helps you deploy it later)
          4. build everything
          5. deploy these files to your local maven repo
          6. Change your poms that reference the release plugin to reference the one you built via the new groupId and the new version
          Show
          Dave Copeland added a comment - - edited Michael - if you are desperate and don't want to wait, you can use it now with a bit of elbow grease (this is what we're doing where I work): checkout the 2.0-beta-9 via https://svn.apache.org/repos/asf/maven/release/tags/maven-release-2.0-beta-9 (you need both the release manager and the release plugin, which this url will get you) apply the patch (the latest of the two; I don't have perms to delete the bad one) Change the groupId and version in all three poms (this helps you deploy it later) build everything deploy these files to your local maven repo Change your poms that reference the release plugin to reference the one you built via the new groupId and the new version
          Hide
          Michael Wenig added a comment -

          Hi Dave,

          thanks for this workaround - that's exactly the one I have to make but leads to some discussions If there would be a new beta in the next weeks we could avoid that...

          And as the patch is still there and working I think it should be possible with only little effort to apply it officially

          Regards Michael

          Show
          Michael Wenig added a comment - Hi Dave, thanks for this workaround - that's exactly the one I have to make but leads to some discussions If there would be a new beta in the next weeks we could avoid that... And as the patch is still there and working I think it should be possible with only little effort to apply it officially Regards Michael
          Hide
          Jeff Skjonsby added a comment -

          I've added another patch with unit tests that adds substitution for [groupId], [artifactId] and [version]

          Example:
          <tag>releases/[version]</tag>

          Show
          Jeff Skjonsby added a comment - I've added another patch with unit tests that adds substitution for [groupId] , [artifactId] and [version] Example: <tag>releases/ [version] </tag>
          Hide
          Wim Deblauwe added a comment -

          Would it be possible to add support for making the tag uppercase?

          Show
          Wim Deblauwe added a comment - Would it be possible to add support for making the tag uppercase?
          Hide
          Jeff Skjonsby added a comment -

          Here's an updated patch that fixes a couple issues in the first patch. This patch has been working well in our internal release process.

          Show
          Jeff Skjonsby added a comment - Here's an updated patch that fixes a couple issues in the first patch. This patch has been working well in our internal release process.
          Hide
          Michael Wenig added a comment - - edited

          I added a new patch file which is the second one from Dave ported to the final Release-Plugin Version 2.0

          Note:
          The patch was made against a copy of the release-tag in our local svn - so ignore the revision number

          Show
          Michael Wenig added a comment - - edited I added a new patch file which is the second one from Dave ported to the final Release-Plugin Version 2.0 Note: The patch was made against a copy of the release-tag in our local svn - so ignore the revision number
          Hide
          Michael Wenig added a comment -

          Please, please include it for the next release!

          Show
          Michael Wenig added a comment - Please, please include it for the next release!
          Hide
          Brett Porter added a comment -

          updated patch to review

          Show
          Brett Porter added a comment - updated patch to review
          Hide
          Laksiri Dasun added a comment - - edited

          Hi Dave , could you please tell me what should i write in tagNameformat inorder to get only the releseVersion as the tag.

          eg: "1.0.0"

          Show
          Laksiri Dasun added a comment - - edited Hi Dave , could you please tell me what should i write in tagNameformat inorder to get only the releseVersion as the tag. eg: "1.0.0"
          Hide
          Dave Copeland added a comment -

          From my comment above:

          This adds the configuration option tagNameFormat that takes a Java MessageFormat string, where {0} is the artifact name and {1} is the version (as such, the default is {0}-{1}; what it is currently).

          So, if you just wanted the version, you can do

          <tagNameFormat>{1}</tagNameForamt>
          
          Show
          Dave Copeland added a comment - From my comment above: This adds the configuration option tagNameFormat that takes a Java MessageFormat string, where {0} is the artifact name and {1} is the version (as such, the default is {0}-{1}; what it is currently). So, if you just wanted the version, you can do <tagNameFormat> {1} </tagNameForamt>
          Hide
          Laksiri Dasun added a comment -

          Thanks a lot Dave. I managed to get it done. and i do a small change as well

            
          +     * Specify the format of the tag as a java MessageFormat string.  
          +     * {0} is the artifact id, {1} is the tag version.
          +     * @parameter expression="${remoteTagging}" default-value="{0}-{1}"
          +     */    
          +    private String tagNameFormat;
          

          expression="$

          {remoteTagging}

          " should be changed as expression="$

          {tagNameFormat}

          "

          Great work Dave wonder why still it didn't released.

          Show
          Laksiri Dasun added a comment - Thanks a lot Dave. I managed to get it done. and i do a small change as well + * Specify the format of the tag as a java MessageFormat string. + * {0} is the artifact id, {1} is the tag version. + * @parameter expression="${remoteTagging}" default-value="{0}-{1}" + */ + private String tagNameFormat; expression="$ {remoteTagging} " should be changed as expression="$ {tagNameFormat} " Great work Dave wonder why still it didn't released.
          Hide
          Stephen Connolly added a comment -

          r1139359

          Show
          Stephen Connolly added a comment - r1139359

            People

            • Assignee:
              stephenconnolly
              Reporter:
              Joerg Schaible
            • Votes:
              38 Vote for this issue
              Watchers:
              29 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development