title: Get State of Maven Execution within Shell Script
body: <p>I'd like to know whether there's a way to kind of 'query' the state of an Maven execution from within a Shell script (used for build process).</p>
  
  <p>The point is that I would like to let the whole build script fail as soon as a single error appears within one of the Shell scripts Maven executions.</p>
  
  <p>e.g.</p>
  
  <pre><code>(0) mvn -f .../someDir clean
  (1) mvn -f .../1/pom.xml install
  (2) mvn -f .../2/pom.xml -PgenerateWadl
  </code></pre>
  
  <p>So if e.g. there occurs an error within (0), then (1) and (2) must no more be executed, but instead the build script should quit with an error message directly after (0).</p>
  
  <p>I'm not THAT much into Shell scripting, but I know of the $? variable to get the return value of an earlier execution. But as Maven simply seems to write errors out to the console, this might not work, does it?</p>
  
  <p>I would have liked to research more information concerning the "$?", but it's quite hard to google for it.</p>