I have a Gradle script that downloads the latest snapshot artifact from a Nexus server. It's been working fine with Gradle 5.4 but doesn't seem to be willing to work after upgrading to Gradle 6.5.
These are the build.gradle contents:
apply plugin: "java"
repositories {
maven {
url "https://somerepo.com/repository/app-snapshot/"
credentials {
username 'a-user'
password 'a-password'
}
authentication {
basic(BasicAuthentication)
}
}
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
configurations {
component
}
dependencies {
component group: "com.bla.ble, name: "component-name", version: "${version}-SNAPSHOT"
}
task copyComponent(type: Copy) {
from configurations.component
into "/some/local/path"
}
Gradle fails as follows:
Execution failed for task ':copyWorkflow'.
> Could not resolve all files for configuration ':workflow'.
> Could not find com.bla.ble:component-name:3.2.0-SNAPSHOT.
Searched in the following locations:
- https://somerepo.com/repository/app-snapshot/com/bla/ble/component-name/3.2.0-SNAPSHOT/maven-metadata.xml
- https://somerepo.com/repository/app-snapshot/com/bla/ble/component-name/3.2.0-SNAPSHOT/component-name-3.2.0-20201130.163046-11.pom
Required by:
project :
I've I navigate to https://somerepo.com/repository/app-snapshot/com/bla/ble/component-name/3.2.0-SNAPSHOT/maven-metadata.xml this provides a valid metadata file and points to a snapshot that actually has a valid file.
I've then tried downgrading again to Gradle 5.4 and worked OK. I was also trying to find any deprecated options in Gradle 6.x but couldn't find what it makes it fail.