In my build.gradle for a Java project, I have a list of Maven repositories I am pointing to for dependency resolution, as follows:
repositories {
maven { url "https://artifactory.myco.com/artifactory/maven-us-east-1-local" } maven { url "https://artifactory.myco.com/artifactory/maven_snapshots-us-east-1-local" } mavenCentral() }
It looks like the snapshots repo above barfs during resolution when gradle tries to see if a non-snapshot dependency lives there, as it goes through and contacts each repo in order. In artifactory it has been configured with a policy and it sends back a 409 conflict when it gets asked if it has a non-snapshot dependency. This is what I get:
./gradlew build . . . FAILURE: Build failed with an exception.
- What went wrong: Could not resolve all dependencies for configuration > 'com.myco.project:pgs_common:compile'. Could not resolve mydep:mydep:1.0.9. Required by: com.myco.project:pgs_common:1.28.0-SNAPSHOT
Could not resolve mydep:mydep:1.0.9 Could not get resource 'https://artifactory.myco.com/artifactory/maven_snapshots-us-east-1-local/mydep/mydep/1.0.9/mydep-1.0.9.pom'. Could not GET > 'https://artifactory.myco.com/artifactory/maven_snapshots-us-east-1-local/mydep/mydep/1.0.9/mydep-1.0.9.pom'. Received status code 409 from server: Conflict
Is there a way in gradle to tell it to not bother contacting that repo for non-snapshot dependencies? In Maven you can add extra properties in a repository declaration telling Maven whether it allows release dependencies, snapshot dependencies, or both (the default).
Thanks.