Plugin Publish plugin ignores ~/.gradle/gradle.properties if the project has a gradle.properties file

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:

Execution failed for task ':publishPlugins'.
> Missing publishing keys. Please set gradle.publish.key and gradle.publish.secret system properties or login using the login task.

I’ve verified that the properties are configured correctly by outputting them from the build script:

println project.getProperty('gradle.publish.key')
println project.getProperty('gradle.publish.secret')

Strangely, if I remove my project’s gradle.properties file, it works as expected and uses the properties configured in ~/.gradle/gradle.properties.

1 Like

Hi Andy

This looks like a bug. The workaround is to either set the properties in the local gradle.properties or set them as system properties. I’ll raise a JIRA issue.

Regards

Tom

1 Like

Raised GRADLE-3281

1 Like