Gradle代理设置

2024-06-24 10:32:04 浏览数 (2)

修改 ~/.gradle/gradle.properties 文件,添加代理配置。

对于http和https代理,添加如下内容:

代码语言:javascript复制
systemProp.http.proxyHost=<host>
systemProp.http.proxyPort=<port>
# systemProp.http.proxyUser=<user>
# systemProp.http.proxyPassword=<password>
# systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost

systemProp.https.proxyHost=<host>
systemProp.https.proxyPort=<port>
# systemProp.https.proxyUser=<user>
# systemProp.https.proxyPassword=<password>
# systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost

对于socks代理,添加如下内容:

代码语言:javascript复制
systemProp.socks.proxyHost=localhost
systemProp.socks.proxyPort=9090
# systemProp.socks.proxyUser=<user>
# systemProp.socks.proxyPassword=<password>
# systemProp.socks.nonProxyHosts=*.nonproxyrepos.com|localhost

0 人点赞