Configure a hudson maven job to keep building if there are test failures, but only deploy if there are no test failures

落花浮王杯 提交于 2019-12-04 03:25:56

There is an post build option called Deploy artifacts to Maven repository. If you do not select Deploy even if the build is unstable, then that mean if test fails, it won't deploy anything. Together with the -fae in the command, thing should work in your desired way

maybe you can try use mvn -fae option with you jobs on hudson - it make maven fail only after full build

If build time isn't a problem for you, I think the better option is to create another job, just for deploying. Something like this:

  1. Configure your original job (let's call it "build job") with "mvn -fae clean install"
  2. Create a new job ("deploy job") with "mvn deploy", and don't configure any Build triggers for it
  3. In the "build job", enable the Build other projects option, under Post-build actions and set it to run your "deploy job".

Maybe you can try to configure both jobs to use the same workspace, saving some time on the whole build/deploy process.

If you happen to use Artifactory as a repository manager, you can use the Hudson/Jenkins Artifactory plugin to deploy your artifacts. This plugin will only deploy your artifacts if all tests pass for all modules of a Maven build.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!