I build my application using Maven. In my script after I build the app I startup application server. The problem is that if build is not succesfull the application server is started any way.
If I execute (with bad version that does not compile)
mvn compile echo "$?" if [ $? != 0 ]; then echo "is not 0" else echo "is 0" fi
the output is
1 is 0
How to make the if return is not 0 ?