How to use Gradle behind a firewall without setting a password, just a user?

The title says everything, I am currently using a file in my ".gradle" directory called "gradle.properties" to set the material systempProp.http.proxy* . I noticed that with Grails you do not need to set http.proxy.proxyPassword only http.proxHost , http.proxyPort and http.proxyUser in the .grails \ ProxySettings.groovy file.

Is there any system program / configuration that I can use, so I don’t need to enter my password in plain text using Gradle?

+7
grails gradle
source share
1 answer

Gradle cannot eliminate the need for a password if it requires a proxy server. If, however, you do not want to check your password for code (obviously this is a stupid thing :)), you should use environment variables to hide it.

You can either set the env: http.proxyPassword to your password, or run gradle with the -D option:

 gradle -Dhttp.proxyHost=*** -Dhttp.proxyPort=*** -Dhttp.proxyUser=**** -Dhttp.proxyPassword=**** 

Keep in mind that if someone else builds your code without the proper env variables, their assembly may fail, so be sure to include the correct instructions.

Also note that there is another set of properties for https. Oh, and if your proxy server interferes with SSL certificates, you may also need to import your proxy certificates into your trusted network.

+2
source share

All Articles