mvn clean test
if [[ "$?" -ne 0 ]] ; then
echo 'could not perform tests'; exit $rc
fi
$?is a special shell variable that contains the exit code (whether it terminated successfully, or not) of the most immediate recently executed command.-nestands for “not equal”. So here we are testing if the exit code frommvn cleanis not equal to zero.