title: Artifactory virtual repository cannot resolve the Gradle-Artifactory plugin
body: <p>So, I am at my wits end with trying to get the build-info-extractor-gradle plugin to work...sorry for venting.  ;-)</p>
  
  <p>I'm using the gradle wrapper, specifying gradle 1.6, artifactory 3.0.0, and trying to specify a dependency on the build-info-extractor-gradle plugin 2.1.x-SNAPSHOT, as this is the <a href="http://www.jfrog.com/confluence/display/RTF/Gradle+1.5+Publishing+Artifactory+Plugin" rel="noreferrer">specified version</a> for gradle 1.5 and above.</p>
  
  <p>I was attempting to follow this <a href="http://www.youtube.com/watch?v=zhhCD5qtocg" rel="noreferrer">tutorial video</a>, but it must be out-dated because it is still referencing gradle 1.0 and specifying jfrog repo paths, which don't contain 2.x versions of the plugin.</p>
  
  <hr>
  
  <h3>Artifactory Setup</h3>
  
  <ul>
  <li>local repo - "gradle-release-local" - layout set to gradle-default</li>
  <li>remote repo - "gradle-plugins" - slightly modified from the jfrog import - e.g. <a href="http://repo.jfrog.org/artifactory/gradle-plugins-snapshots" rel="noreferrer">http://repo.jfrog.org/artifactory/gradle-plugins-snapshots</a></li>
  <li>virtual repo - "gradle" - "gradle-release-local" and "gradle-plugins"</li>
  </ul>
  
  <hr>
  
  <h3>Gradle Setup</h3>
  
  <p>settings.gradle (generated from artifactory)</p>
  
  <pre><code>buildscript {
      repositories {
          maven {
              url 'http://artifactory.build.somewhere.com:8081/artifactory/gradle'
              credentials {
                  username = "${artifactory_user}"
                  password = "${artifactory_password}"
              }
          }
  
      }
      dependencies {
          classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:2.1.x-SNAPSHOT'
      }
  }
  
  allprojects {
      apply plugin: 'artifactory'
  }
  
  artifactory {
      contextUrl = "${artifactory_contextUrl}"   //The base Artifactory URL if not overridden by the publisher/resolver
      publish {
          repository {
              repoKey = 'gradle-release-local'
              username = "${artifactory_user}"
              password = "${artifactory_password}"
              maven = true
              ivy {
                  ivyLayout = '[organization]/[module]/ivy-[revision].xml'
                  artifactLayout = '[organization]/[module]/[revision]/[module]-[revision](-[classifier]).[ext]'
                  mavenCompatible = false
              }
          }
      }
      resolve {
          repository {
              repoKey = 'gradle'
              username = "${artifactory_user}"
              password = "${artifactory_password}"
              maven = true
  
          }
      }
  }
  </code></pre>
  
  <p>My repository configuration does work, if I upload the jar, locally, e.g. this is how I got the build-info-extractor-gradle jar to be downloaded.  However, all of the dependencies fail, as you can see:</p>
  
  <pre><code>    $ gradlew tasks
  
      FAILURE: Build failed with an exception.
  
      * What went wrong:
      Could not resolve all dependencies for configuration 'classpath'.
      &gt; Could not find commons-io:commons-io:2.0.1.
        Required by:
            unspecified:unspecified:unspecified &gt; org.jfrog.buildinfo:build-info-extractor-gradle:2.1.x-SNAPSHOT
      &gt; Could not find org.apache.ivy:ivy:2.2.0.
        Required by:
            unspecified:unspecified:unspecified &gt; org.jfrog.buildinfo:build-info-extractor-
  ...
      * Try:
      Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  
      BUILD FAILED
  </code></pre>
  
  <hr>
  
  <p>Any ideas of what's wrong with either my gradle configuration or my artifactory repo configuration?  Why can't it resolve external dependencies from remote repositories?  Should I just add mavenCentral?</p>
  
  <hr>
  
  <h3>Update</h3>
  
  <p>I added mavenCentral() to the repositories, just to see what would happen and got:</p>
  
  <pre><code>$ gradlew tasks
  Download http://repo1.maven.org/maven2/commons-io/commons-io/2.0.1/commons-io-2.0.1.pom
  Download http://repo1.maven.org/maven2/org/apache/commons/commons-parent/15/commons-parent-15.pom
  Download http://repo1.maven.org/maven2/org/apache/ivy/ivy/2.2.0/ivy-2.2.0.pom
  Download http://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom
  Download http://repo1.maven.org/maven2/org/apache/commons/commons-parent/5/commons-parent-5.pom
  Download http://repo1.maven.org/maven2/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.pom
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Could not resolve all dependencies for configuration 'classpath'.
  &gt; Could not find org.jfrog.buildinfo:build-info-extractor:2.1.x-SNAPSHOT.
    Required by:
        unspecified:unspecified:unspecified &gt; org.jfrog.buildinfo:build-info-extractor-gradle:2.1.x-SNAPSHOT
  
  * Try:
  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
  
  BUILD FAILED
  </code></pre>
  
  <hr>
  
  <h3>Update #2</h3>
  
  <p>Started fresh.  Removed mavenCentral() and the locally uploaded jar and pom, then ran with --info and --refresh-dependencies:</p>
  
  <pre><code>$ gradlew --refresh-dependencies -i tasks
  Starting Build
  Settings evaluated using empty settings script.
  Projects loaded. Root project using build file 'D:\repos\some_build\build.gradle'.
  Included projects: [root project 'some_build']
  Evaluating root project 'some_build' using build file 'D:\repos\some_build\build.gradle'.
  Compiling build file 'D:\repos\some_build\build.gradle' using BuildScriptClasspathScriptTransformer.
  Resource missing. [HTTP GET: http://artifactory.build.somewhere.com:8081/artifactory/gradle/org/jfrog/buildinfo/build-info-extractor-gradle/2.1.0/build-info-extractor-gradle-2.1.0.pom]
  Resource missing. [HTTP HEAD: http://artifactory.build.somewhere.com:8081/artifactory/gradle/org/jfrog/buildinfo/build-info-extractor-gradle/2.1.0/build-info-extractor-gradle-2.1.0.jar]
  
  FAILURE: Build failed with an exception.
  </code></pre>
  
  <p>So, clearly, my virtual "gradle" repo is not finding the artifact.  How can I tell if it is searching the remote "gradle-plugins" repo?</p>