title: Gradle Not Resolving Maven Repo on localhost
body: <p>I have setup an <a href="http://archiva.apache.org/" rel="nofollow">Archiva</a> instance on my localhost using the default configuration. I have tried several different Gradle configs to resolve to the archiva instance, but none seem to work.</p>
  
  <ol>
  <li>using mavenRepo</li>
  <li>maven</li>
  <li>using Ivy and only specifying the artifact pattern (which worked when I used Ivy)</li>
  </ol>
  
  <p><strong>build.gradle</strong></p>
  
  <pre><code>subprojects {
      apply plugin: 'java'
      apply plugin: 'maven'
  
      repositories {
          mavenRepo url: 'http://localhost:8080/archiva', artifactUrls: [
              'http://localhost:8080/archiva/repository/internal',
              'http://localhost:8080/archiva/repository/snapshot'
          ]
          maven { url 'http://localhost:8080/archiva' }
          ivy {
              artifactPattern 'http://localhost:8080/archiva/repository/internal/[organisation]/[artifact]/[revision]/[artifact](-[revision]).[ext]'
          }
          mavenCentral()
      }
  
      dependencies {
          testCompile group: 'junit', name: 'junit', version: '4.10'
      }
  }
  
  dependsOnChildren()
  </code></pre>
  
  <p>I didn't think it was pertinent post any/all the subproject gradle files, but if you think it is necessary I can.</p>
  
  <p>Is there something I'm missing here? Does gradle treat localhost urls differently than non-localhost (because the <code>mavenCentral</code> dependencies are being resolved)? What do I have to do to get Gradle to resolve to a local instance of a Maven repo?</p>
  
  <p><strong>EDIT:</strong> @Peter Niederwieser</p>
  
  <pre><code>:/&gt; gradle build
  &gt; Loading &gt; Resolving dependencies ':projects:project-plugin-framework:classpat
  :projects:compileJava UP-TO-DATE
  :projects:processResources UP-TO-DATE
  :projects:classes UP-TO-DATE
  :projects:jar UP-TO-DATE
  :projects:assemble UP-TO-DATE
  :projects:compileTestJava UP-TO-DATE
  :projects:processTestResources UP-TO-DATE
  :projects:testClasses UP-TO-DATE
  :projects:test UP-TO-DATE
  :projects:check UP-TO-DATE
  :projects:build UP-TO-DATE
  :projects:project-plugin-framework:compileJava UP-TO-DATE
  :projects:project-plugin-framework:processResources UP-TO-DATE
  :projects:project-plugin-framework:classes UP-TO-DATE
  :projects:project-plugin-framework:jar UP-TO-DATE
  :projects:project:compileJava UP-TO-DATE
  :projects:project:processResources UP-TO-DATE
  :projects:project:classes UP-TO-DATE
  :projects:project:jar UP-TO-DATE
  :projects:project:assemble UP-TO-DATE
  :projects:project:compileTestJava UP-TO-DATE
  :projects:project:processTestResources UP-TO-DATE
  :projects:project:testClasses UP-TO-DATE
  &gt; Building &gt; :projects:project:test &gt; Resolving dependencies ':projects:mag
  :projects:project:test
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Could not resolve all dependencies for configuration ':projects:project:tes
  tRuntime'.
  &gt; Could not find group:jspf, module:jspf.core, version:1.0.2.
    Required by:
        Project.projects:project:0.0.1
        Project.projects:project:0.0.1 &gt; Project.projects:project-pl
  ugin-framework:0.0.1
  &gt; Could not find any version that matches group:erichschroeter, module:applib, v
  ersion:latest.integration.
    Required by:
        Project.projects:project:0.0.1
        Project.projects:project:0.0.1 &gt; Project.projects:project-pl
  ugin-framework:0.0.1
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug
  option to get more log output.
  
  BUILD FAILED
  
  Total time: 12.61 secs
  </code></pre>