I ran Maven build ( mvn clean install) in our Jenkins pipeline, we use the Surefire plugin to run our tests, one test failed, and we see that Maven prints BUILD FAILED and that the exit code is 0. What's the reason for this? (Exit code 0 means Success)
My code looks like that:
mvn clean install
RESULT=$?
if [ $RESULT -ne 0 ];then exit 1; fi;