When we run mvn clean install from a batch (*.cmd) script, %ERRORLEVEL% is always 0 regardless if the build completes sucessfully or fails. How can you get Maven to return a non zero code for failures?
mvn clean install
echo error:%ERRORLEVEL%
We're using Maven 2.
Update:
Note that if we do "mvn blah" then ERRORLEVEL=1 after the failure due to the bad target.
But if we do "mvn clean install" where the build fails due to a complication error we still get ERRORLEVEL=0.
Update 2:
Ok, this is because we are running Maven like:
mvn clean install | tee %LOGFILE%
I guess it's tee that is setting the ERRORLEVEL.
Ok, this is because we are running Maven like:
mvn clean install | tee %LOGFILE%
I guess it's tee that is setting the ERRORLEVEL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With