title: Executing Maven task from shell script and getting error codes
body: <p>I'm executing a Maven deploy task from a bash script however even if the Maven task fails the script will continue and complete without errors.</p>
  
  <p>I have tried the -e flag but that causes the deploy to fail. I also tried the following (pseudo code) </p>
  
  <pre><code>result_code= mvn deploy
  if [$result_code -gt 0];then
  exit 1
  </code></pre>
  
  <p>Any suggestions how i can identify if the deploy was successful?</p>