当使用git-1.8.5,maven-release-plugin(使用版本2.4.2和2.3.2测试)和mvn(使用版本3.1.1和3.0.5测试)时,运行mvn release:prepare
并mvn release:prepare-with-pom
失败。
mvn release:prepare
无法创建它应该创建的提交:
[maven-release-plugin]为下一次开发迭代做准备 [maven-release-plugin]准备发布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]
答案 0 :(得分:9)
根据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 status
的格式进行了重大更改,因此现在像maven-release-plugin这样的脚本应该使用瓷器选项git status --porcelain
而不是git status
。< / LI>
maven-scm-provider-gitexe:1.8
with maven-release-plugin:2.4.2。--porcelain
标记包含maven-scm-provider-gitexe:1.8.1,但是maven-release-plugin:2.4.2没有依赖maven-scm-provider- gitexe已更新。有关详细信息,请参阅https://jira.codehaus.org/browse/SCM-686。答案 1 :(得分:5)
这似乎已在3月5日发布的maven-release-plugin 2.5版本中得到修复。