title: Gradle build fails because of Nexus returning 400 Bad Request
body: <p>We have a company-wide Nexus 3 server which</p>
  
  <ul>
  <li>hosts our own artifacts and</li>
  <li>is used as proxy to Maven Central and other repos.</li>
  </ul>
  
  <p>The developers use two repositories:</p>
  
  <ul>
  <li>maven-releases for all released/stable artifacts with the <a href="https://books.sonatype.com/nexus-book/3.0/reference/maven.html#maven-repository-format" rel="noreferrer">version policy</a> "Release" and</li>
  <li>maven-snapshots for all snapshots artifacts with the version policy "Snapshot".</li>
  </ul>
  
  <p>Both repositories are used in a Gradle build:</p>
  
  <pre><code>repositories {
      maven {
          name "snapshots"
          url "http://nexus3.server:8081/repository/maven-snapshots"
      }
  
      maven {
          name "releases"
          url "http://nexus3.server:8081/repository/maven-releases"
      }
  }
  </code></pre>
  
  <p>Now when Gradle tries to resolve a snapshot-dependency it asks the releases-repository, Nexus answers with</p>
  
  <pre><code>Error 400 Bad Request
  Repository version policy: RELEASE does not allow version: 1.0-SNAPSHOT
  </code></pre>
  
  <p>and the build fails with</p>
  
  <pre><code>&gt; Could not resolve group.id:artifact-id:1.0-SNAPSHOT.
   Required by:
       :my-project:unspecified
    &gt; Could not resolve group.id:artifact-id:1.0-SNAPSHOT.
       &gt; Could not get resource 'http://nexus3.server:8081/repository/maven-releases/group/id/artifact-id/1.0-SNAPSHOT/artifact-id-1.0-SNAPSHOT.pom'.
          &gt; Could not GET 'http://nexus3.server:8081/repository/maven-releases/group/id/artifact-id/1.0-SNAPSHOT/artifact-id-1.0-SNAPSHOT.pom'. Received status code 400 from server: Bad Request
  </code></pre>
  
  <p>How do I need to configure Gradle so that this error is ignored and the next repository ("snapshots") is tried? Or is it possible to configure Nexus to return 404 Not Found instead of 400 Bad Request?</p>
  
  <p>Version: Gradle 2.9</p>