We have a corporate Nexus 3 server, which
- places our own artifacts and
- Used as a proxy for Maven Central and other repositories.
Developers use two repositories:
- maven releases for all released / stable artifacts with release and
- maven-snapshots for all snapshot artifacts with the snapshot version policy.
Both repositories are used in the Gradle assembly:
repositories { maven { name "snapshots" url "http://nexus3.server:8081/repository/maven-snapshots" } maven { name "releases" url "http://nexus3.server:8081/repository/maven-releases" } }
Now when Gradle is trying to resolve the snapshot dependency, it is requesting a release repository, Nexus answers to
Error 400 Bad Request Repository version policy: RELEASE does not allow version: 1.0-SNAPSHOT
and build failure using
> Could not resolve group.id:artifact-id:1.0-SNAPSHOT. Required by: :my-project:unspecified > Could not resolve group.id:artifact-id:1.0-SNAPSHOT. > Could not get resource 'http://nexus3.server:8081/repository/maven-releases/group/id/artifact-id/1.0-SNAPSHOT/artifact-id-1.0-SNAPSHOT.pom'. > 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
How do I configure Gradle to ignore this error and test the following repository ("snapshots")? Or can you configure Nexus to return 404 Not Found instead of 400 Bad Request?
Version: Gradle 2.9
source share