You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now provided two ways to set username and password config. by ~/.gradle/gradle.properties or by system env.
But if want different project has different username and password settings, I found it so hard to do it.
I want the plugin to read config in project local.properties, but it can't
Or I read it by myself and set it to this plugin, but I can not find how to set it by parameters
It's hard to change system env in the gradle scripts which I tried, but not working
private fun Project.setSystemEnv() {
// set environment variable
val envMap = mapOf(
"ORG_GRADLE_PROJECT_mavenCentralUsername" to getLocalProperties("mavenCentralUsername", ""),
"ORG_GRADLE_PROJECT_mavenCentralPassword" to getLocalProperties("mavenCentralPassword", ""),
"ORG_GRADLE_PROJECT_signingInMemoryKey" to getSigningInMemoryKey(),
"ORG_GRADLE_PROJECT_signingInMemoryKeyId" to getLocalProperties("signing.keyId", ""),
"ORG_GRADLE_PROJECT_signingInMemoryKeyPassword" to getLocalProperties("signing.password", "")
)
// or set in ~/.gradle/gradle.properties, but I do not want to share with other projects
// mavenCentralUsername
// mavenCentralPassword
// signing.keyId
// signing.password
// signing.secretKeyRingFile
// detail in https://vanniktech.github.io/gradle-maven-publish-plugin/central/#configuring-the-pom
tasks.withType(Exec::class.java).configureEach {
// set env
environment(envMap)
envMap.forEach { (key, value) ->
if (value.isNotEmpty()) {
System.setProperty(key, value)
}
}
}
}
The text was updated successfully, but these errors were encountered:
I need the same capability, we are using secrets.properties to provide our credentials for the project, and since the gradle.properties is committed to the git, we can not save the credentials in that file, and ~/.gradle/gradle.properties is ok but in that case we need to maintain two places for credentials, and it's preferable to have all of them in the secrets.properties.
basically, I need to provide a new properties file to the gradle plugin and it reads the variables from that file
Now provided two ways to set username and password config. by ~/.gradle/gradle.properties or by system env.
But if want different project has different username and password settings, I found it so hard to do it.
The text was updated successfully, but these errors were encountered: