title: How can I use Groovy Postbuild to force a job to success?
body: <p>I am trying to force a unit test job to success if the main build returned a failed exit code.  Here is how I configured it and it is not working (see screenshot).  Does anyone know any reason why this shouldn't work?   In this example I just want to show that a failing job can be changed to a passing job by a groovy postbuild step. <a href="https://wiki.jenkins-ci.org/display/JENKINS/Groovy+Postbuild+Plugin" rel="nofollow noreferrer">The plugin doc implies that this should work.</a></p>
  
  <ol>
  <li>The main build runs a batch script with "EXIT 1" to fail the build.</li>
  <li>A Groovy Postbuild step runs manager.buildSuccess() in an attempt to force the build to success (but it fails to do so with no error).</li>
  </ol>
  
  <p><img src="https://i.stack.imgur.com/nE6K5.png" alt="my screenshot"></p>