Hudson 和 maven-release-plugin
我将 Hudson 与 maven-release-plugin 一起使用。
您可能知道,maven-release-plugin 构建项目分两步:release:prepare
,然后 release:perform
。
如果 release:perform
失败,我应该如何配置 Hudson 来执行 release:rollback
?
I'm using Hudson with the maven-release-plugin.
As you may know, the maven-release-plugin builds project in 2 steps: release:prepare
, then release:perform
.
How should I configure Hudson to execute release:rollback
in case release:perform
failed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
使用 Hudson/Jenkins 执行发布的标准方法是 Jenkins M2 发布插件< /a>.它包装了 Maven 发布插件并自动执行它。
The standard way of performing release with Hudson/Jenkins is the Jenkins M2 release plugin. It wraps the maven release plugin and automates its execution.
简短的回答:不。关闭更新(每次都进行干净的检查)。 FWIW,根据我的经验发布:回滚无论如何都不是非常可靠。
Short answer: don't. Turn off update (do a clean checkout each time). FWIW, in my experience release:rollback isn't terribly reliable anyways.
如果这是绝对需要的,那么您应该能够执行“调用顶级 Maven 目标”构建步骤,在该步骤中您将调用release:prepare 和release:perform,并通过“执行系统groovy”捕获此构建的结果脚本”构建步骤。
看看这里如何检查 pom.xml 的版本(它可能会让您知道执行是否失败)。
If this is absolutely needed, than you should be able to do a "Invoke top-level Maven targets" build step where you will invoke the release:prepare and release:perform and catch on the result of this build through a "Execute system groovy script" build step.
Take a look here how to check pom.xml for versions (it might give you an idea if the perform failed or not).