2016-04-19 29 views
3

當沒有代理服務器時jcenter不可訪問,爲了解決依賴關係,我想用襪子代替http代理,我怎樣才能在commanad行中使用它? 我知道如何使用HTTP代理:如何在命令行中使用gradle進行依賴關係解析?

-Dhttp.proxyHost=yourProxy -Dhttp.proxyPort=yourPort 
-Dhttp.proxyUser=usernameProxy -Dhttp.proxyPassword=yourPassoword 
+0

您可以在** gradle.properties **配置文件中設置代理。只需添加這兩行: 'systemProp.socks.proxyHost = 127.0.0.1 systemProp.socks.proxyPort = 1080' –

回答

4

我找到答案,在這裏你可以使用:使用你上面

./gradlew -DsocksProxyHost=yourHost 
-DsocksProxyPort=yourHostPort your-command 

可以設置襪子主機和端口。