Hudson and maven-release-plugin
I'm using Hudson with the maven-release-plug开发者_开发技巧in.
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?
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.
Short answer: don't. Turn off update (do a clean checkout each time). FWIW, in my experience release:rollback isn't terribly reliable anyways.
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).
精彩评论