title: Resolving ivy dependencies on a proxied repository with gradle leads to missing resources
body: <p>We have a master - slave repository approach set up with nexus pro as a master and a nexus pro as slave, where our snapshot and releases repositories are configured to be proxied (moreover using the smartproxy technology from sonatype nexus).</p>
  
  <p>Our project is a multiproject build which is based upon Gradle and Ivy. We use dynamic versions (e.g. 1.+) to define and resolve dependencies.</p>
  
  <p>The problem is that an artifact can't be resolved on a proxy, that has correctly beeing published to the master repository and is not beeing forwarded to the slave (proxy) repository (e.g. due to network problems or the fact that a slave repository can be set up <em>after</em> the publishing of the given artifact).</p>
  
  <p>As I found out (see <a href="http://www.gradle.org/docs/current/userguide/dependency_management.html#sub%3amore_about_ivy_resolvers" rel="nofollow">docu in gradle</a>), the gradle dependency resolver uses directory listing:</p>
  
  <blockquote>
    <p>If the dependency is declared as a dynamic version (like 1.+), Gradle will resolve this to the newest available static version (like 1.2) in the repository. For Maven repositories, this is done using the maven-metadata.xml file, while for Ivy repositories this is done by directory listing.</p>
  </blockquote>
  
  <p>Unfortunately since that artifact and the directory structure is not available, the process of resolution fails. Calling <code>gradle --info --refresh-dependencies</code> results to </p>
  
  <pre><code>Executing task ':resolve' (up-to-date check took 0.001 secs) due to:
  Task has not declared any outputs.
  Resource missing. [HTTP GET:     http://proxy/nexus/content/repositories/testrepo/com/company/smpro/test/SmartproxyTest/]
  :resolve FAILED
  :resolve (Thread[main,5,main]) completed. Took 0.668 secs.</code></pre>
  
  <p>I would have thought that the Nexus is resolving that URL on the master where the artifact list would be available through a directory listing, but it doesn't. If I put the upper URL into the browser, I get 404:</p>
  
  <pre><code>404 - ItemNotFoundException
  Request is marked as local-only, remote access not allowed from M2Repository(id=testrepo)
  </code></pre>
  
  <p>If I call it on the master repo, it works of course.</p>
  
  <p>My question now: Has anybody any clue, why this can't be resolved at the master via the proxy, which it should normally do? </p>
  
  <p>Thanks,
  Fred</p>