title: how to detect a build error from ant/maven via a bash script?
body: <p>I am writing a bash script to automate the build process. There are two major build blocks, one is an ant task and one is a plain old <code>mvn clean install</code>. I want to do something when there is build error coming from either of this two build processes. </p>
  
  <p>The problem is, these builds will contain test failures or errors from time to time, but the end result is successful. And I believe that the status code ($?) return by these processes should be 0 no matter the build fail or succeed, I could be wrong.</p>
  
  <p>So what is the best way for my script to detect the end result (build fail/succeed) without catching the false info during the mid build (test errors, etc) from them?</p>