Hudson and maven-release-plugin

2020-08-17 08:00发布

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?

3条回答
可以哭但决不认输i
2楼-- · 2020-08-17 08:14

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.

查看更多
Luminary・发光体
3楼-- · 2020-08-17 08:20

Short answer: don't. Turn off update (do a clean checkout each time). FWIW, in my experience release:rollback isn't terribly reliable anyways.

查看更多
劳资没心,怎么记你
4楼-- · 2020-08-17 08:30

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).

查看更多
登录 后发表回答