title: Gradle deploy artifacts to a maven repository inside a local directory
body: <p>What is Gradle's equivalent of Maven's:</p>
  
  <pre><code>&lt;distributionManagement&gt;
      &lt;repository&gt;
          &lt;id&gt;internal.repo&lt;/id&gt;
          &lt;name&gt;Temporary Staging Repository&lt;/name&gt;
          &lt;url&gt;file://${project.build.directory}/mvn-repo&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/distributionManagement&gt;
  
  &lt;build&gt;
   &lt;plugins&gt;
      &lt;plugin&gt;
          &lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
          &lt;version&gt;2.8.1&lt;/version&gt;
          &lt;configuration&gt;
                 &lt;altDeploymentRepository&gt;internal.repo::default::file://${project.build.directory}/mvn-repo&lt;/altDeploymentRepository&gt;
          &lt;/configuration&gt;
      &lt;/plugin&gt;
   &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>apply plugin: 'maven'
  
  uploadArchives {
      repositories {
          mavenDeployer {
              repository(url: "file:///tmp/mvn-repo")
          }
      }
  }
  </code></pre>
  
  <p>but it throws:</p>
  
  <pre><code>[ant:null] Error reading settings file '/private/var/folders/KH/KH+cubLjEESWzOTqVrx-bU+++TI/-Tmp-/gradle_empty_settings7564764539012703872.xml' - ignoring. Error was: /private/var/folders/KH/KH+cubLjEESWzOTqVrx-bU+++TI/-Tmp-/gradle_empty_settings7564764539012703872.xml (No such file or directory)
  </code></pre>
  
  <p>The project that I am working on is <code>git://github.com/SpringSource/spring-data-rest.git</code> branch <code>1.0.0.RELEASE</code>, <a href="https://fisheye.springsource.org/browse/~br=1.0.0.RELEASE/datarest/build.gradle?r=316ac5d9424435f6c09c4baa4f3109f840f93cf1" rel="noreferrer">project's build.gradle</a>.</p>
  
  <p>Complete Gradle output:</p>
  
  <pre><code>gradle uploadArchives
  The groovy configuration has been deprecated and is scheduled to be removed in Gradle 2.0. Typically, usages of 'groovy' can simply be replaced with 'compile'. In some cases, it may be necessary to additionally configure the 'groovyClasspath' property of GroovyCompile and Groovydoc tasks.
  :uploadArchives
  [ant:null] Error reading settings file '/private/var/folders/KH/KH+cubLjEESWzOTqVrx-bU+++TI/-Tmp-/gradle_empty_settings396071803108301794.xml' - ignoring. Error was: /private/var/folders/KH/KH+cubLjEESWzOTqVrx-bU+++TI/-Tmp-/gradle_empty_settings396071803108301794.xml (No such file or directory)
  :spring-data-rest-core:compileJava UP-TO-DATE
  :spring-data-rest-core:compileGroovy UP-TO-DATE
  :spring-data-rest-core:processResources UP-TO-DATE
  :spring-data-rest-core:classes UP-TO-DATE
  :spring-data-rest-core:jar UP-TO-DATE
  :spring-data-rest-core:javadoc UP-TO-DATE
  :spring-data-rest-core:javadocJar UP-TO-DATE
  :spring-data-rest-core:sourcesJar UP-TO-DATE
  :spring-data-rest-core:uploadArchives
  :spring-data-rest-repository:compileJava UP-TO-DATE
  :spring-data-rest-repository:compileGroovy UP-TO-DATE
  :spring-data-rest-repository:processResources UP-TO-DATE
  :spring-data-rest-repository:classes UP-TO-DATE
  :spring-data-rest-repository:jar UP-TO-DATE
  :spring-data-rest-repository:javadoc UP-TO-DATE
  :spring-data-rest-repository:javadocJar UP-TO-DATE
  :spring-data-rest-repository:sourcesJar UP-TO-DATE
  :spring-data-rest-repository:uploadArchives
  :spring-data-rest-webmvc:compileJava UP-TO-DATE
  :spring-data-rest-webmvc:compileGroovy UP-TO-DATE
  :spring-data-rest-webmvc:processResources UP-TO-DATE
  :spring-data-rest-webmvc:classes UP-TO-DATE
  :spring-data-rest-webmvc:jar UP-TO-DATE
  :spring-data-rest-webmvc:javadoc UP-TO-DATE
  :spring-data-rest-webmvc:javadocJar UP-TO-DATE
  :spring-data-rest-webmvc:sourcesJar UP-TO-DATE
  :spring-data-rest-webmvc:uploadArchives
  </code></pre>
  
  <p>I use Gradle 1.12.</p>