我有一个存储在我们的 GIT 存储库中的 Maven 项目。当我使用 mvn release:prepare
和 mvn release:perform
发布这个项目时,有时它会在后面的步骤中失败,但无论如何都会为这个版本创建一个标签。此标记不会通过 mvn release:rollback
删除,如果我尝试再次准备发布,它会失败并显示此标记已存在错误:
[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]
有没有办法让 mvn release:rollback
删除我们 GIT 存储库中的最后一个标签?
我正在使用这个发布插件:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.2</version>
</plugin>
最佳答案
Maven 发布插件目前不支持此功能。
参见此处: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.
门票 ( https://issues.apache.org/jira/browse/MRELEASE-229 ) 自 2007 年以来一直开放。
关于git - 获取 mvn 版本 :rollback to delete tag in GIT,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31266388/