Reputation: 5262
I do publish an open source library to Maven Central. In order to do that the gradle.build
file contains variable references to a gradle.properties
file which contains secret information like usernames and passwords.
Of course the build.gradle
needs to be published to the public git repository, the gradle.properties
should not be published, due to containing all the personal information but without the properties file the build.gradle
is not valid.
How are open source projects handling those sensitive data?
Upvotes: 2
Views: 514
Reputation: 12096
Here is a solution based on this answer, with the use of findProperty
method to allow users to build your project without providing the publishing credentials (issue you mentioned in your comment above)
gradle.properties
and put them to your local user /.gradle/gradle.properties
configuration filein your publish task definition, use:
authentication(userName: findProperty('mavenUser'), password: findProperty('mavenPassword'))
Upvotes: 1