title: ERROR: Failed to create C:\.m2 in job running on Jenkins - Azure
body: <p>I created a web application in my Azure's portal with the intention of deploying the last jenkins.war. I followed all the necessary steps: repository cloning, uploading of the war renamed as ROOT.war and finally got it up and running.</p>
  
  <p>Then I configured git, Maven and added a new job against a GitHub repository of mine.</p>
  
  <p>The problem is that when the jobs starts to build, after checking out correctly from GitHub, I get the following error:</p>
  
  <pre><code>Checking out Revision 63d0972e8a96a1661c6875d5cb39544b18e5d39e (refs/remotes/origin/master)
   &gt; D:\Program Files (x86)\Git\bin\git.exe config core.sparsecheckout # timeout=10
   &gt; D:\Program Files (x86)\Git\bin\git.exe checkout -f 63d0972e8a96a1661c6875d5cb39544b18e5d39e
   &gt; D:\Program Files (x86)\Git\bin\git.exe rev-list 63d0972e8a96a1661c6875d5cb39544b18e5d39e # timeout=10
  Parsing POMs
  ERROR: Failed to create C:\.m2
  Finished: FAILURE
  </code></pre>
  
  <p>It seems that by default it tries to create the .m2 folder in a place where it doesn't have r/w permission.</p>
  
  <p>Ideally I could configure the settings.xml localRepository in the server to point somewhere else like(D:/.m2), </p>
  
  <p>I found out that I can FTP into the server so I uploaded a settings.xml file and configured the global maven settings to point at that file.</p>
  
  <p><strong>/site/wwwroot/%HOME%/site/wwwroot/jenkins_home/jenkins.mvn.GlobalMavenConfig.xml:</strong></p>
  
  
  
  <pre><code>&lt;jenkins.mvn.GlobalMavenConfig&gt;
    &lt;settingsProvider class="jenkins.mvn.FilePathSettingsProvider"&gt;
      &lt;path&gt;D:\home\site\settings.xml&lt;/path&gt;
    &lt;/settingsProvider&gt;
    &lt;globalSettingsProvider class="jenkins.mvn.DefaultGlobalSettingsProvider"/&gt;
  &lt;/jenkins.mvn.GlobalMavenConfig&gt;
  </code></pre>
  
  <p><strong>/site/settings.xml:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" 
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
            xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"&gt;
            &lt;localRepository&gt;D:/.m2&lt;/localRepository&gt;
  &lt;/settings&gt;
  </code></pre>
  
  <p>However it still fails showing <code>ERROR: Failed to create C:\.m2</code>.</p>
  
  <p>Some help?</p>