简体   繁体   English

使用maven-release-plugin和git-1.8.5

[英]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:preparemvn 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: 背景:

这似乎已在3月5日发布的maven-release-plugin 2.5版本中得到修复。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM