I am trying to configure build.gradle with azure devops artifacts repo. It was working earlier with AZURE_ARTIFACTS credentials BUT azure recently changed the way build.gradle connects to artifacts repo
url 'https://pkgs.dev.azure.com/dp-name/_packaging/dp-name/maven/v1'
name 'dp-name'
authentication {
basic(BasicAuthentication)
}
}
gradle build fails with the following error
> Could not resolve all dependencies for configuration ':compileClasspath'.
> You cannot configure authentication schemes for this repository type if no credentials are provided.
* Try:
I had a similar issue with a multi-project build that I was able to solve with a hint on this documentation page on subprojects and plugins: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl
This is what my root build.gradle file looks like - Note: I did not have to edit the subprojects build.gradle files.
plugins {
id "net.linguica.maven-settings" version "0.5"
}
...
repositories {
maven {
url 'https://pkgs.dev.azure.com/<org>/<repoId>/_packaging/platform/maven/v1'
name '<name>'
authentication {
basic(BasicAuthentication)
}
}
}
...
subprojects {
apply plugin: 'net.linguica.maven-settings'
...
}
I had the same issue. I resolved it by adding maven settings plugin:
buildscript {
...
dependencies {
...
classpath "net.linguica.gradle:maven-settings-plugin:0.5"
}
}
apply plugin: 'net.linguica.maven-settings'
After that gradle succeed with authorization to azure feed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With