When we run mvn clean install from the package (* .cmd) script,% ERRORLEVEL% is always 0 regardless of whether the build succeeds or fails. How can you make Maven return non-zero code for crashes?
mvn clean install
echo error:%ERRORLEVEL%
We are using Maven 2.
Update:
Note that if we do "mvn blah", then ERRORLEVEL = 1 after the failure due to a bad target.
But if we do "mvn clean install" when the build failed due to a complication error, we still get ERRORLEVEL = 0.
Update 2:
Well, this is because we run Maven as:
mvn clean install | tee% LOGFILE%
I think this is the tee that sets ERRORLEVEL.
source
share