title: Specifying Maven's local repository location as a CLI parameter
body: <p>Is it possible to set the location of the local Maven repository as argument on the Maven command line?</p>
  
  <p>The thing is that I don't use the default one in <code>~/.m2/repository</code>. However I checked out some project that is being built with its own settings with <code>-s settings.xml</code>. That settings.xml doesn't specify my local repository, so Maven uses uses <code>~/.m2/repository</code> again... I would like to use a non-default local repository location without having to add a <code>&lt;localRepository&gt;</code> element in the project's settings.xml</p>
  
  <p>I've tried</p>
  
  <ul>
  <li><code>-DlocalRepository="..."</code> </li>
  <li><code>$mvn invoker:run -s settings.xml clean install -DskipTests -DlocalRepositoryPath=</code></li>
  <li><code>-Dsettings.localRepository</code></li>
  </ul>
  
  <p>but none of these options works.</p>
  
  <p>So I think I have to decide whether I will be modifying a third party settings.xml or move my local repo to <code>~</code></p>