title: Continuous integration strategy for snapshot dependencies (with Jenkins)
body: <p>While setting up a Jenkins CI system for the first time, I wonder how to deal with snapshot dependencies and the local Maven repository.</p>
  
  <p>We have an artifact X with dependency Y. Jenkins is configured to build X everytime Y has a commit.</p>
  
  <p><strong>Strategy A (workspace Maven repository):</strong><br>
  The local Maven repository is configured to be "local to the workspace". This means that every built job has its own repository. A commit of Y does trigger the build (a "mvn clean install"), but since the repositories of build X and Y are isolated, X uses the last <em>deployed</em> version of Y, not the last commit.<br>
  Using this strategy seems useful to detect if all dependencies are also deployed, but it doesn't detect integration issues (broken Y commit breaks X).</p>
  
  <p><strong>Strategy B (common Maven repository):</strong><br>
  Jenkins uses a common local Maven repository. A commit of a (broken) Y snapshot triggers the build of X which uses the current Y snapshot, and integration issues are detected. The drawback is, that this doesn't detect if all build dependencies are deployed to the central snapshot repository (because the CI system does have them all installed in the local repository).</p>
  
  <p>Is there a strategy that combines both advantages of A and B?</p>