问题
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?
回答1:
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.
回答2:
Short answer: don't. Turn off update (do a clean checkout each time). FWIW, in my experience release:rollback isn't terribly reliable anyways.
回答3:
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).
来源:https://stackoverflow.com/questions/4831080/hudson-and-maven-release-plugin