在gradle.properties文件中添加如下配置:
配置http proxy:
systemProp.http.proxyHost=www.somehost.org
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=userid
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
配置https proxy:
systemProp.https.proxyHost=www.somehost.org
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=userid
systemProp.https.proxyPassword=password
# NOTE: this is not a typo.
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
配置SOCKS proxy:
systemProp.socksProxyHost=www.somehost.org
systemProp.socksProxyPort=1080
systemProp.java.net.socks.username=userid
systemProp.java.net.socks.password=password
如果在代理软件中出现unknown Socks version: 67错误,需要将代理设置为SOCKS proxy
官方文档连接:https://docs.gradle.org/current/userguide/networking.html
标签:http,配置,代理,Gradle,proxy,https,org,password,systemProp From: https://www.cnblogs.com/hekk/p/18416084