[英]Using maven-release-plugin with git-1.8.5
When using git-1.8.5, with maven-release-plugin (tested with versions 2.4.2 and 2.3.2) with mvn (tested with versions 3.1.1 and 3.0.5), running mvn release:prepare
and mvn release:prepare-with-pom
fails. 当使用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
fails to create the commits that it's supposed to create: mvn release:prepare
无法创建它应该创建的提交:
[maven-release-plugin] prepare for next development iteration [maven-release-plugin]为下一次开发迭代做准备
[maven-release-plugin] prepare release foo-1.0.0 [maven-release-plugin]准备发布foo-1.0.0
and mvn release:prepare-with-pom
fails with a git error: 和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]
As per Mark Derricutt's solution , explicitly add the maven-scm-provider-gitexe:1.8.1 dependency to the maven-release-plugin:2.4.2 plugin: 根据Mark Derricutt的解决方案 ,明确将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>
Background: 背景:
git status
, so now scripts like maven-release-plugin should use the porcelain option git status --porcelain
instead of git status
. git-1.8.5引入了对git status
格式的重大改变,所以现在像maven-release-plugin这样的脚本应该使用瓷器选项git status --porcelain
而不是git status
。 maven-scm-provider-gitexe:1.8
with maven-release-plugin:2.4.2 . 因此, Robert Scholte无法将依赖关系包含在maven-scm-provider-gitexe:1.8
with maven-release-plugin:2.4.2 。 --porcelain
flag with maven-scm-provider-gitexe:1.8.1 , but maven-release-plugin:2.4.2 does not have its dependency for maven-scm-provider-gitexe updated yet. git的maven scm提供程序包含了修复程序,包括带有maven-scm-provider-gitexe:1.8.1的--porcelain
标志,但maven-release-plugin:2.4.2对maven-scm-provider没有依赖性-gitexe已更新。 See https://jira.codehaus.org/browse/SCM-686 for more info. 有关详细信息,请参阅https://jira.codehaus.org/browse/SCM-686 。 这似乎已在3月5日发布的maven-release-plugin 2.5版本中得到修复。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.