nuhkoca
06/18/2022, 8:23 PMmaven("<https://path/to/dependencies>") {
name = "fooBar"
credentials(PasswordCredentials::class)
}
Hello I have a password protected remote packages and trying to use PasswordCredentials
but I only have a password
not username
. How do I leave username
empty and just inject password from gradle.properties
?Vampire
06/18/2022, 9:40 PMnuhkoca
06/19/2022, 8:07 AMAdam S
06/19/2022, 7:45 PMproviders.gradleProperty("<insert-variable-here>")
You can try this, but I'm not sure this will work without a username...
// build.gradle.kts
val fooBarPassword = providers.gradleProperty("fooBarPassword")
repositories {
maven("https://...") {
name = "fooBar"
credentials {
username = "" // might be necessary?
password = fooBarPassword.get()
}
}
}
this answer explains more about `providers.gradleProperty(...)`: https://stackoverflow.com/a/72075210/4161471Vampire
06/19/2022, 8:17 PMVampire
06/19/2022, 8:18 PMVampire
06/19/2022, 8:20 PMgildor
06/22/2022, 3:55 AMVampire
06/22/2022, 7:52 AM