title: Maven - alternative .m2 directory
body: <p>How do I globally change the location of maven's <code>.m2</code> directory?</p>
  
  <p>Maven uses <code>${user.home}/.m2</code> for it's settings, repository cache, etc.</p>
  
  <p>I know that I can:</p>
  
  <ul>
  <li>point to a different dir for the repository cache (by changing the <code>localRepository</code> attribute in my global config file), but not for anything else (<code>settings.xml</code>, for instance).</li>
  <li>Use the <code>-s</code> CLI option, but I'd have to do that every time I use maven.</li>
  </ul>
  
  <p>But ideally, I'd like a global solution.  Intuitively that should be possible..</p>
  
  <p>I'd like to do this because my company sets my ${user.home} to a shared drive which is prone to network issues.</p>