title: Hudson -> java.lang.OutOfMemoryError: Java heap space on maven clean test package -P deploy in Hudson
body: <p>I have a maven project in Hudson that builds with the following build options:</p>
  
  <p><img src="https://i.stack.imgur.com/628zB.gif" alt="Screenshot of Hudson maven config"></p>
  
  <p>The build often fails with an OutOfMemoryError: Java heap space but I don't know why.</p>
  
  <p>The failure looks like this:</p>
  
  <pre><code>[INFO] BUILD SUCCESSFUL
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 38 seconds
  [INFO] Finished at: Mon Feb 28 17:04:28 EST 2011
  [INFO] Final Memory: 48M/95M
  [INFO] ------------------------------------------------------------------------
  channel stopped
  Deploying artifacts to http://test/archiva/repository/snapshots
  Deploying the main artifact pom.xml
  [INFO ] Retrieving previous build number from test-archiva-default
  [INFO ] Uploading project information for home-buildings 2.0-SNAPSHOT
  [INFO ] Retrieving previous metadata from test-archiva-default
  [INFO ] Uploading repository metadata for: 'snapshot com.test.home:core:2.0-SNAPSHOT'
  [INFO ] Retrieving previous metadata from test-archiva-default
  [INFO ] Uploading repository metadata for: 'artifact com.test.home:core'
  Deploying the main artifact core.ear
  [INFO ] Retrieving previous build number from test-archiva-default
  [INFO ] Retrieving previous metadata from test-archiva-default
  [INFO ] Uploading repository metadata for: 'snapshot com.test.home:core-ear:2.0-SNAPSHOT'
  [INFO ] Retrieving previous metadata from test-archiva-default
  [INFO ] Uploading repository metadata for: 'artifact com.test.home:core-ear'
  [INFO ] Uploading project information for core-ear 2.0-SNAPSHOT
  Deploying the main artifact core.war
  [INFO ] Retrieving previous build number from test-archiva-default
  FATAL: Java heap space
  java.lang.OutOfMemoryError: Java heap space
  </code></pre>
  
  <p>Does anyone have any idea of how to stop this from occurring?</p>