I try to set the pluginManagement.repositories
in the init.gradle
file similar to what I already do with
ext.RepoConfigurator
for the usual dependency repositories.
Suddenly this no longer works in a matter that I have
apply plugin: EnterpriseRepositoryPlugin
class EnterpriseRepositoryPlugin implements Plugin<Gradle> {
void apply(Gradle gradle) {
gradle.settingsEvaluated { settings ->
// code to determine and set settings.ext.ourNexusAnyUser / settings.ext.ourNexusAnyPassword
settings.pluginManagement {
repositories {
gradlePluginPortal()
maven {
url = 'redacted'
credentials(PasswordCredentials) {
username settings.ext.ourNexusAnyUser
password settings.ext.ourNexusAnyPassword
}
}
maven {
name = 'kw-maven-releases'
url = 'redacted'
credentials(PasswordCredentials) {
username settings.ext.ourNexusAnyUser
password settings.ext.ourNexusAnyPassword
}
}
}
}
}
}
}
with the error
* What went wrong:
Could not find method username() for arguments [provider(?)] on Credentials [username: null] of type org.gradle.internal.credentials.DefaultPasswordCredentials_Decorated.
I am unsure what actually changed overall. This issue came up with Access providers in EnterpriseRepositoryPlugin in init.gradle altogether