【问题标题】:Using maven-release-plugin with git-1.8.5将 maven-release-plugin 与 git-1.8.5 一起使用
【发布时间】:2014-01-03 20:37:57
【问题描述】:

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

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] 

【问题讨论】:

标签: git maven-release-plugin


【解决方案1】:

根据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>

背景:

【讨论】:

    【解决方案2】:

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

    【讨论】:

    • 谢谢乔伊,jira.codehaus.org/browse/MRELEASE-862 似乎修复了它。需要注意的另一件事是凯利戴维斯在jira.codehaus.org/browse/MRELEASE-767 中提到的 - 尚未确认,但这可能是多模块项目的问题(我相信解决方法是在每个子模块的 pom 中添加一个 scm 标签)就像在父 pom 中一样。)
    • 好吧,我还没有看到 MRELEASE-767 中描述的关于我们在github.com/overturetool/overture 的(大量)多模块项目中描述的行为,所以我怀疑修复是可以的。
    猜你喜欢
    • 2023-03-07
    • 2013-07-05
    • 2013-08-19
    • 2013-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-28
    • 1970-01-01
    相关资源
    最近更新 更多