title: Is it possible to have a maven build write a file when it fails?
body: <p>I have a maven build running in a Jenkins job.</p>
  
  <p>I need to do some post-processing stuff after the maven build but during the job, and so I'm running mvn with the -fn (--fail-never) option (jenkins will halt the job immediately otherwise).</p>
  
  <p>The catch, of course, is that if the maven build step failed, I need to fail the job in a subsequent build step.</p>
  
  <p>In the past I've done this sort of thing by writing a file to a certain location if the build failed, and then using the Ant  task to fail the build. So this is the approach I'm going for.</p>
  
  <p>Is it possible to get maven to write a file on build failure?</p>