title: How to Specify Private Maven Repository Strategy in Jenkins Pre Steps?
body: <p>I have configured a "Maven Project" in Jenkins that consists of two steps:</p>
  
  <ol>
  <li>Pre Step - Invoke top-level Maven targets: <code>mvn install &lt;some pom.xml&gt;</code></li>
  <li>Build: <code>mvn install &lt;root pom.xml&gt;</code></li>
  </ol>
  
  <p>In both steps, I selected the option "Use private Maven repository" to enforce all artifacts being installed into the $WORKSPACE/.repository directory. However, I have two problems with that:</p>
  
  <ol>
  <li>In the Build step, I can select between "default", "local to the executor" and "local to the workspace", but in the Pre Step, no strategy is available! How can I chose a strategy in the Pre Step?</li>
  <li>According to the info icon on the side, selecting "Use private Maven repository" in the Pre Step has the effect that "Jenkins will tell Maven to use $WORKSPACE/.repository as the local Maven repository". However, this is not at all the case! The built artifacts end up in ~/.m2, not as expected in the job's local workspace...</li>
  </ol>
  
  <p>In the documentation of the <a href="http://javadoc.jenkins-ci.org/hudson/tasks/Maven.html#usePrivateRepository" rel="nofollow">usePrivateRepository</a> flag, the following is written:</p>
  
  <blockquote>
    <p>If true, the build will use its own local Maven repository via "-Dmaven.repo.local=...".</p>
  </blockquote>
  
  <p>I'm really wondering what those <code>...</code>are and if that value can be modified. Any advice is highly appreciated.</p>