I have a maven project which is stored in our GIT repository. When I make a release of this project with mvn release:prepare
and mvn release:perform
sometimes it fails in the later step but a tag is created for this release anyway. This tag doesn't get removed with mvn release:rollback
, and if I try to prepare the release again it fails with this tag-already-exists error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5.2:prepare (default-cli) on project lwl-module: Unable to tag SCM
[ERROR] Provider message:
[ERROR] The git-tag command failed.
[ERROR] Command output:
[ERROR] fatal: tag 'lwl-module-1.5.1' already exists
[ERROR] -> [Help 1]
[ERROR]
Is there a way to get mvn release:rollback
to delete the last tag in our GIT repository?
I'm using this release plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.2</version>
</plugin>
This is currently not supported by the Maven Release Plugin.
See here: http://maven.apache.org/maven-release/maven-release-plugin/examples/rollback-release.html
The created branch/tag in SCM for the release is removed. Note: This is not yet implemented so you will need to manually remove the branch/tag from your SCM. For more info see MRELEASE-229.
The ticket (https://issues.apache.org/jira/browse/MRELEASE-229) has been open since 2007.
Depending on the problem that caused mvn release:perfom
to fail, you can also just not rollback the release and after having fixed the problem run mvn release:perform
directly, without running mvn release:prepare
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With