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

tagNameFormat with @{project.version} tags the SNAPSHOT version

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: prepare
    • Labels:
      None
    • Number of attachments :
      1

      Description

      The much awaited (by me) MRELEASE-159 seems not to work. I tried a release with the following pom:

                  <plugin>
                      <groupId>org.apache.maven.plugins</groupId>
                      <artifactId>maven-release-plugin</artifactId>
                      <configuration>
                          <localCheckout>true</localCheckout>
                          <preparationGoals>clean install verify</preparationGoals>
                          <goals>clean install javadoc:javadoc assembly:assembly deploy</goals>
                          <arguments>-P${release.profiles} -DaltDeploymentRepository="${altDeploymentRepository}"</arguments>
                          <tagNameFormat>@{project.version}</tagNameFormat>
                      </configuration>
                  </plugin>
      

      but I got the tag 1.0-ALPHA-2-SNAPSHOT in place of 1.0-ALPHA-2.

        Issue Links

          Activity

          Hide
          Aristedes Maniatis added a comment -

          I can confirm. And I just wasted the last 3 hours of my life on this very simple bug. This makes the release plugin 2.2 very broken and almost useless for any regular user, since the tag created when you don't override tagNameFormat is incorrect. If you are re-using the same snapshot version (eg. 2.0b1 -> 2.0-SNAPSHOT -> 2.0b2 -> 2.0-SNAPSHOT) then everything breaks when the release cannot create the incorrect tag.

          Downgrading to 2.1 solves the problem.

          Show
          Aristedes Maniatis added a comment - I can confirm. And I just wasted the last 3 hours of my life on this very simple bug. This makes the release plugin 2.2 very broken and almost useless for any regular user, since the tag created when you don't override tagNameFormat is incorrect. If you are re-using the same snapshot version (eg. 2.0b1 -> 2.0-SNAPSHOT -> 2.0b2 -> 2.0-SNAPSHOT) then everything breaks when the release cannot create the incorrect tag. Downgrading to 2.1 solves the problem.
          Hide
          Fabrizio Giudici added a comment -

          BTW, I've downgraded to 2.1 as well. It's very unfortunate than a RFE which seems not to difficult to implement took almost 5 years to be implemented broken (just a consideration, not bashing anyone).

          Show
          Fabrizio Giudici added a comment - BTW, I've downgraded to 2.1 as well. It's very unfortunate than a RFE which seems not to difficult to implement took almost 5 years to be implemented broken (just a consideration, not bashing anyone).
          Hide
          Carlo de Wolf added a comment -

          The variable is already resolved before InputVariablesPhase#execute gets a chance. So essentially the code that inserts releaseVersion and does an extra interpolate is moot.

          Show
          Carlo de Wolf added a comment - The variable is already resolved before InputVariablesPhase#execute gets a chance. So essentially the code that inserts releaseVersion and does an extra interpolate is moot.
          Hide
          Duncan Jones added a comment -

          I just encountered this bug on a recent project. However, having performed several successful releases on other projects in the past, I was intrigued why the issue has occurred. I had initially assumed it was because I moved to v2.4 and the other successfully tagged projects had used v2.2.1. However, when I enforced v2.2.1 on my failing project, the issue still occurred.

          Rolling back to v2.1 solved the problem for me also. However, it does nothing to help explain why other projects have been tagged correctly using v2.2.1.

          Show
          Duncan Jones added a comment - I just encountered this bug on a recent project. However, having performed several successful releases on other projects in the past, I was intrigued why the issue has occurred. I had initially assumed it was because I moved to v2.4 and the other successfully tagged projects had used v2.2.1. However, when I enforced v2.2.1 on my failing project, the issue still occurred. Rolling back to v2.1 solved the problem for me also. However, it does nothing to help explain why other projects have been tagged correctly using v2.2.1.
          Hide
          Robert Scholte added a comment -

          I've used the tagNameFormat today without any problem with version 2.3.2. This part of the code hasn't been touched for 2.4, so I expect that it still behaves the same.
          So in order to solve this I really need a sample project to reproduce the issue.

          Show
          Robert Scholte added a comment - I've used the tagNameFormat today without any problem with version 2.3.2. This part of the code hasn't been touched for 2.4, so I expect that it still behaves the same. So in order to solve this I really need a sample project to reproduce the issue.
          Hide
          M Weiss added a comment - - edited

          Attached you find a project where you can reproduce the issue. Please use your own SVN Repo and correct this informations in the pom file.

          If you run release:prepare in interactive mode you'll see the issue:
          "What is SCM release tag or label for "test-artifact"? (test-group:test-artifact) test-artifact-V0.0.1-SNAPSHOT:"
          Here you should be asked for "test-artifact-V0.0.1" and not "test-artifact-V0.0.1-SNAPSHOT" because the tagNameFormat is set to:
          $

          {project.artifactId}

          -V$

          {project.version}

          This issue still exists in version 2.4.1.

          Show
          M Weiss added a comment - - edited Attached you find a project where you can reproduce the issue. Please use your own SVN Repo and correct this informations in the pom file. If you run release:prepare in interactive mode you'll see the issue: "What is SCM release tag or label for "test-artifact"? (test-group:test-artifact) test-artifact-V0.0.1-SNAPSHOT:" Here you should be asked for "test-artifact-V0.0.1" and not "test-artifact-V0.0.1-SNAPSHOT" because the tagNameFormat is set to: $ {project.artifactId} -V$ {project.version} This issue still exists in version 2.4.1.
          Hide
          Robert Scholte added a comment -

          M Weiss, you shouldn't be using the dollar-sign, but the at-sign. When using the $ Maven will use the resolved value, which is still a -SNAPSHOT at that moment.

          Show
          Robert Scholte added a comment - M Weiss , you shouldn't be using the dollar-sign, but the at-sign. When using the $ Maven will use the resolved value, which is still a -SNAPSHOT at that moment.
          Hide
          M Weiss added a comment -

          Hi Robert, thx for your help. That solved my problem and sets the correct tagName.

          Show
          M Weiss added a comment - Hi Robert, thx for your help. That solved my problem and sets the correct tagName.

            People

            • Assignee:
              Unassigned
              Reporter:
              Fabrizio Giudici
            • Votes:
              8 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

              • Created:
                Updated: