Allow configuring credentials for custom Gradle plugin repository (#61)

This commit is contained in:
Iurii Ignatko
2024-03-06 08:48:24 +02:00
committed by GitHub
parent b00d9dd511
commit 579fbbe722
3 changed files with 64 additions and 10 deletions

View File

@@ -21,6 +21,8 @@ initscript {
}
def pluginRepositoryUrl = getInputParam('gradle.plugin-repository.url')
def pluginRepositoryUsername = getInputParam('gradle.plugin-repository.username')
def pluginRepositoryPassword = getInputParam('gradle.plugin-repository.password')
def gePluginVersion = getInputParam('develocity.plugin.version')
def ccudPluginVersion = getInputParam('develocity.ccud-plugin.version')
@@ -32,7 +34,19 @@ initscript {
logger.lifecycle("Develocity plugins resolution: $pluginRepositoryUrl")
repositories {
maven { url pluginRepositoryUrl }
maven {
url pluginRepositoryUrl
if (pluginRepositoryUsername && pluginRepositoryPassword) {
logger.lifecycle("Using credentials for plugin repository")
credentials {
username(pluginRepositoryUsername)
password(pluginRepositoryPassword)
}
authentication {
basic(BasicAuthentication)
}
}
}
}
}