gpt4 book ai didi

git - 在 git-1.8.5 中使用 maven-release-plugin

转载 作者:太空狗 更新时间:2023-10-29 13:16:45 28 4
gpt4 key购买 nike

使用 git-1.8.5 时,使用 maven-release-plugin(测试版本 2.4.2 和 2.3.2)和 mvn(测试版本 3.1.1 和 3.0.5),运行 mvn release :preparemvn release:prepare-with-pom 失败。

mvn release:prepare 未能创建它应该创建的提交:

[maven-release-plugin] prepare for next development iteration
[maven-release-plugin] prepare release foo-1.0.0

mvn release:prepare-with-pom 失败并出现 git 错误:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.4.2:prepare-with-pom (default-cli) on project foo: Cannot remove release POMs from SCM
[ERROR] Provider message:
[ERROR] The git command failed.
[ERROR] Command output:
[ERROR] error: the following file has changes staged in the index:
[ERROR] release-pom.xml
[ERROR] (use --cached to keep the file, or -f to force removal)
[ERROR] -> [Help 1]
[ERROR]

最佳答案

根据 Mark Derricutt's solution , 显式添加 maven-scm-provider-gitexe:1.8.1 依赖到 maven-release-plugin:2.4.2 插件:

<build>
<plugins>
<!-- ... -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.4.2</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.scm</groupId>
<artifactId>maven-scm-provider-gitexe</artifactId>
<!-- This version is necessary for use with git version 1.8.5 -->
<version>1.8.1</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

背景:

关于git - 在 git-1.8.5 中使用 maven-release-plugin,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20912299/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com