简体   繁体   English

Hudson和maven-release-plugin

[英]Hudson and maven-release-plugin

I'm using Hudson with the maven-release-plugin . 我正在使用Hudson和maven-release-plugin

As you may know, the maven-release-plugin builds project in 2 steps: release:prepare , then release:perform . 您可能知道,maven-release-plugin通过两个步骤构建项目: release:prepare ,然后release:perform

How should I configure Hudson to execute release:rollback in case release:perform failed? 我应该如何配置Hudson来执行release:rollback in case release:perform failed?

The standard way of performing release with Hudson/Jenkins is the Jenkins M2 release plugin . 与Hudson / Jenkins一起执行发布的标准方法是Jenkins M2发布插件 It wraps the maven release plugin and automates its execution. 它包装maven发布插件并自动执行。

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. 如果这是绝对需要的,那么你应该能够执行“调用顶级Maven目标”构建步骤,您将调用该版本:准备和发布:通过“执行系统groovy”执行并捕获此构建的结果脚本“构建步骤。
Take a look here how to check pom.xml for versions (it might give you an idea if the perform failed or not). 看看这里如何检查pom.xml的版本(如果执行失败,它可能会让你知道)。

Short answer: don't. 简答:不要。 Turn off update (do a clean checkout each time). 关闭更新(每次都做一次干净的结账)。 FWIW, in my experience release:rollback isn't terribly reliable anyways. FWIW,根据我的经验发布:无论如何回滚都不是非常可靠。

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

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