Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
179 views
in Technique[技术] by (71.8m points)

java - Global gradle proxy settings?

Is there any way to simply set up a global, system-wide proxy for gradle?

Yes, I know there is a systemProp.http.proxyHost, ...etc settings in the current gradle.properties file, but it works only in the actual project. But

  • I won't set it up in every gradle project
  • and I won't change the source code of a project because of my local network configuration.

So, is there any "global gradle.properties" file or so?

question from:https://stackoverflow.com/questions/26523804/global-gradle-proxy-settings

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Yes it seems possible. See here, especially:

We can define a gradle.properties file and set the property in this file. We can place the file in our project directory or in the <USER_HOME>/.gradle directory. The properties defined in the property file in our home directory take precedence over the properties defined in the file in our project directory. As a bonus we can also define system properties in a gradle.properties file, we only have to prefix the property name with systemProp..

The gradle.properties files can be found at the following paths:

# windows gradle file
%userprofile%.gradlegradle.properties

# linux gradle file
~/.gradle/gradle.properties 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...