title: How to build an efficient maven/jenkins build queue
body: <p>We use Jenkins as our CI system and Maven as our build tool. We have a SVN repository for our code and Artifactory for our artefacts.</p>
  
  <p>The source code is organized as a multi-module maven project. Most modules contribute to the actual application, but some modules are applications thT we need during the build and test process.</p>
  
  <p>We have currently multiple jobs for:</p>
  
  <ul>
  <li>a quick set of commit tests</li>
  <li>more extensive integration tests</li>
  <li>code coverage and static code analysis</li>
  <li>deployment to an test environment</li>
  <li>smoke tests for that test environment</li>
  </ul>
  
  <p>One weakness of our build process is that we compile different parts of the project in different jobs, some of the parts over and over again. Instead I would prefer to build everything once deploy it to artifactory and just use these artifacts for everything else.</p>
  
  <p>But I don't know how to make sure that:</p>
  
  <ul>
  <li>The size of artifactory doesn't explode, because we dump hundreds of jars every day in it</li>
  <li>downstream builds use the exact set of artifacts produced by the last upstream build job an not some weird mixture of version, because it runs concurrently to the next build job, which might have deployed a new version of artifact a but not of artifact b.</li>
  </ul>
  
  <p>Any help, pointers or ideas appreciated.</p>