title: Jenkins: How configure the Local Maven Repository through the settings.xml file
body: <p>I have installed <code>Maven 3.3.9</code> where the <code>settings.xml</code> file has configured the <code>&lt;localRepository&gt;</code> to a location different than <code>~/.m2/repository</code>. It works how is expected.</p>
  
  <p>For <code>Jenkins 2.x</code> through the <code>Manage Jenkins</code> management menu option, in the <code>Configure System</code> option. I can see the <code>Maven Project Configuration</code> section, where there exists the <code>Local Maven Repository</code> option with a select box with three options:</p>
  
  <ul>
  <li>Default (~/.m2/repository)</li>
  <li>Local to the executor</li>
  <li>Local to the workspace</li>
  </ul>
  
  <p><strong>Note:</strong> the goal is reuse the same <em>custom repository location</em> defined in the <code>settings.xml</code> file, it for any Jenkin's <code>Job</code>. Of course it for any Java or Spring project working with Maven.</p>
  
  <p>These three values always appear even when:</p>
  
  <ul>
  <li>through the <code>Manage Jenkins</code> management menu option, in the <code>Global Tool Configuration</code> option I have defined in the <code>Maven Configuration</code> section the <code>Default settings provider</code> and <code>Default global settings provider</code> settings referring to the same <code>settings.xml</code> file. </li>
  <li>again in <code>Configure System</code> option in the <code>Global properties</code> section for <code>Environment variables</code> section I have created the <code>M2_USER_HOME</code> <em>key</em> referring to the same <em>custom repository location</em> defined in the <code>settings.xml</code> file.</li>
  </ul>
  
  <p>What extra configuration is need it to accomplish the goal?</p>