Project Specific properties in Gradle projects


#1

Is there a way to define project-specific properties in the .gradle directory? Similar to how Git allows configuration on a project level while hiding it from version control through .git/config as opposed to the global configuration ~/.gitconfig?

I’m thinking in particular of the case where one developer may have multiple repository credentials if (s)he is uploading artifacts to multiple repositories.


(Peter Niederwieser) #2

You can put a gradle.properties into the project directory and add it to your .gitignore. Or you can implement a custom solution.


(kellyrob) #3

There’s a plugin(or two) from LinkedIn that gives you some flexible alternatives for local configuration. The org.linkedin.userConfig plugin scans for properties files at specific locations outside of your project structure, and allows overriding at each level.

https://github.com/linkedin/gradle-plugins