How do I provide credentials for Gradle Wrapper without embedding them in my project's file?

(Salim Fadhley) #1

In order to bootstrap Gradle-Wrapper, I need to pull the Gradle distribution from an Artifactory which requires HTTP Basic-Auth.

The Gradle documentation suggests putting the username & password into

If I put into my project then anybody who has access to my source code would would have access to my credentials. Alternatively, if I put the file into my build image then all of my builds will be tied to the same credentials. Neither of these are acceptable.

What I’d much rather do is have Gradle Wrapper pick up it’s credentials from environment variables. My run-time environment makes it very easy to provide the credentials in this way - but is there a way to make Gradle consume the credentials from an environment variable?