[GRADLE-3281] Plugin publishing plugin ignores publishing keys set in ~/.gradle/gradle.properties when there's a project-local gradle.properties Created: 14/Apr/15 Updated: 14/Jan/16 Resolved: 14/Jan/16
|Adrian Kelly (Inactive)
From the forums:
The documentation on the plugin portal states that gradle.publish.key and gradle.publish.secret should be configured in ~/.gradle/gradle.properties. However, it doesn't appear to work:
I've verified that the properties are configured correctly by outputting them from the build script:
Strangely, if I remove my project's gradle.properties file, it works as expected and uses the properties configured in ~/.gradle/gradle.properties.
|Comment by Tom Dunstan [ 14/Apr/15 ]
|Comment by Holger Stolzenberg [ 21/Apr/15 ]
Can confirm this. This is especially annoying within a multi module project.
|Comment by Ned Twigg [ 25/Aug/15 ]
This is killing me. I can't upload from CI without putting my API keys in my project's local gradle.properties (clearly not a good idea for an open source plugin).
|Comment by Holger Stolzenberg [ 26/Aug/15 ]
@Ned Twigg You can work around this by setting these properties to the command line definition that runs on your CI, so you do not have check it in with `gradle.properties`.
or under certain circumstances you may need to use -P instead of -D
|Comment by Ned Twigg [ 26/Aug/15 ]
@Holger Stolzenberg Thanks very much! This fixed it.
|Comment by Julien HENRY [ 04/Nov/15 ]
Same problem here when trying to use both release plugin and publishing plugin:
|Comment by Vyacheslav Rusakov [ 04/Dec/15 ]
Another workaround is to set system properties inside build.gradle:
With this, publishPlugins could be called without parameters
|Comment by Adrian Kelly (Inactive) [ 14/Jan/16 ]
This has been fixed in version 0.9.3 of the plugin