title: How to delete unneeded build artifacts in Hudson
body: <p>I have a <a href="http://hudson-ci.org/" rel="nofollow noreferrer">Hudson CI</a> server which is building a making a maven build. A parent project with two sub projects. One of maven subprojects creates a rather large .war (10MB) file which is stored for every build. I'd like to get rid of that .war file to save disk space, but I'd like to store everything else the Hudson build stores in history (test results, graphs etc.).</p>
  
  <p>The .war file is stored under <code>jobs/PROJECT_NAME/modules/PACKAGE_NAME$SUB_PROJECT_NAME/builds/2009-12-23_11-59-11/archive/PACKAGE_NAME/SUB_PROJECT_NAME/1.0/SUB_PROJECT_NAME-1.0.war</code></p>
  
  <p>I have tried using job configuration according to <a href="https://stackoverflow.com/questions/1719796/remove-artifacts-from-hudson-but-retain-logs-in-order-to-link-to-builds">this SO question</a> namely <em>Archive the artifacts</em> and <em>Discard all but the last successful/stable artifact to save disk space</em>. But that actually does following:</p>
  
  <ol>
  <li>An additional copy is stored for two last build under <code>jobs/PROJECT_NAME/builds/2009-12-29_17-23-39/archive/PROJECT_NAME/web/target/PROJECT_NAME-web-1.0.war</code> . So it actually increases disk space consumption a bit.</li>
  <li>Web page for this hudson jobs contains links to .war files in the two last builds.</li>
  </ol>
  
  <p>My build just executes <code>clean install</code> goals against parent <em>pom.xml</em>.</p>
  
  <p>So how to configure Hudson server and/or Maven to remove build artifacts automatically from under <code>jobs/PROJECT_NAME/modules</code> and leave them under <code>jobs/PROJECT_NAME/builds</code>?</p>