Given the following code using rtMaven and assuming there are test failures
try{
rtMaven.run pom: 'pom.xml', goals: '-B clean install '
}catch(e){
println "test failures?"
}
the build status is set to FAILURE although the exception is caught. Is there any possibility to prevent this and setting to build to UNSTABLE only?
Currently I am doing
rtMaven.run pom: 'pom.xml', goals: '-B clean install -Dmaven.test.failure.ignore=true'
if (manager.logContains(".*There are test failures.*")) {
currentBuild.result = 'UNSTABLE'
}
but obviously this is a fragile workaround...