title: Can I split maven compilation / package and test into two steps without needlessly rebuilding artifacts?
body: <p>I have a large build where tests sometimes prevent creation of artifacts because they stall or terminate the build due to make module timeout. I'd like my build server to:</p>
  
  <ul>
  <li>build and publish artifacts</li>
  <li>run unit / integration tests</li>
  </ul>
  
  <p>At present unit and integration tests execute during each module's test and integration test phases in the typical maven way.  This is great for developers but places risk of lack of build.     The build server can easily setup a build/publish step by skipping the tests and I'd like to run a testing only test that skips process-resources through package phases just running the tests.  However, I'm fairly certain that maven will traverse all the previous stages again.  </p>
  
  <p>I'd like to avoid lengthening an already quite long build by needlessly rebuilding and repackaging my artifacts. </p>
  
  <p>Has anyone split a maven build like this so the desktop developers get the benefit of test integration and the build server / continuous integration system get's the benefit of pushing risky tests to the end of the process so we always produce artifacts?</p>
  
  <p>Am I trying to break the build up in the wrong fashion and should consider changing a monolithic end-to-end build in a series of smaller component builds?</p>
  
  <p>Thanks</p>
  
  <p>Peter</p>