我使用 Mercurial (hg) 作为源代码控制工具,使用 Maven 作为构建系统。
在执行发布过程时(使用 versions-maven-plugin: versions:set -Dxxx=yyy versions:use-releases xxxxx yyy 目标),我获得了有效的 pom 文件来对项目执行有效的发布构建。
现在,当发布构建成功时,下一步是提交更改的文件(由版本插件更改),我正在使用 maven-scm-plugin (scm:checkin 和 scm:tag)。由于我的源代码控制工具是 Mercurial/hg,因此 scm:xxx 操作将调用 hg 命令(而不是 svn 或任何其他工具 - 仅供引用)。
我有 <scm>. for connection and developerConnection..<scm>
的有效设置所以 scm:checkin 按预期工作。
但是在启动 scm:tag 时出现以下错误。有什么想法我做错了什么吗?
PS:
1. 相同的操作(scm:checkin 和 scm:tag)在其他项目中成功运行。
2.我不使用maven-release-plugin
16:05:52 [INFO] --- maven-scm-plugin:1.9.2:tag (default-cli) @ project-parent ---
16:05:52 [INFO] Final Tag Name: '0.0.1'
16:05:52 [INFO] EXECUTING: /bin/sh -c cd /production/jenkins/tools/workspace/ProjectTestApp && hg tag --message 'CM Jenkins - Release plugin auto check-in and creation of release tag = 0.0.1' 0.0.1
18:33:30 [ERROR]
18:33:30 EXECUTION FAILED
18:33:30 Execution of cmd : tag failed with exit code: 255.
18:33:30 Working directory was:
18:33:30 /production/jenkins/tools/workspace/ProjectTestApp
18:33:30 Your Hg installation seems to be valid and complete.
18:33:30 Hg version: 1.9.2 (OK)
16:05:52 [INFO] ------------------------------------------------------------------------
16:05:52 [INFO] BUILD FAILURE
16:05:52 [INFO] ------------------------------------------------------------------------
16:05:52 [INFO] Total time: 7.082 s
16:05:52 [INFO] Finished at: 2014-09-25T16:05:52-05:00
16:05:53 [INFO] Final Memory: 14M/360M
16:05:53 [INFO] ------------------------------------------------------------------------
16:05:53 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-scm-plugin:1.9.2:tag (default-cli) on project project-parent: Cannot run tag command : Exception while executing SCM command. Error while executing command tag --message 'CM Jenkins - Release plugin auto check-in and creation of release tag = 0.0.1' 0.0.1 -> [Help 1]
16:05:53 [ERROR]
16:05:53 [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
16:05:53 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
16:05:53 [ERROR]
16:05:53 [ERROR] For more information about the errors and possible solutions, please read the following articles:
16:05:53 [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
16:05:53 Archiving artifacts
16:05:54 Finished: FAILURE
最佳答案
问题在于 hg/mercurial 中已经存在的标签(最近我正在玩 POC 工作,并从命令行手动在 Hg 中应用了 0.0.1 标签)。
也就是说,要么在项目的 pom.xml 文件中修改版本号以使用更新的 x.x.x-SNAPSHOT 并释放该 x.x.x(不是 0.0.1),要么 hg 克隆项目(或在 SVN 中 checkout )并运行以下(在我的例子中标签是 0.0.1):
hg tag --remove 0.0.1
hg push
执行上述命令后,我确保标签在 Hg(项目父项目的 Web 浏览器)中消失,并尝试在 Jenkins 中进行发布升级过程(使用 versions-maven-plugin、maven-scm-plugin、enforcer 插件) ...按预期工作。
关于Maven - Mercurial/Svn - svn/hg 标记失败,退出代码为 255,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26049310/