Set proxy for gradle

Source: Internet
Author: User

官方文档:http://www.gradle.org/docs/current/userguide/build_environment.html

 

以下配置写在gradle.properties中:

//以下为http协议proxy配置systemProp.http.proxyHost=www.somehost.org //proxy主机systemProp.http.proxyPort=8080 //proxy端口systemProp.http.proxyUser=userid //proxy权限验证用户,没有就删掉该行systemProp.http.proxyPassword=password //proxy权限验证密码,没有就删掉systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost //不使用proxy的域名
//以下为https协议proxy配置,参数作用同http协议systemProp.https.proxyHost=www.somehost.orgsystemProp.https.proxyPort=8080systemProp.https.proxyUser=useridsystemProp.https.proxyPassword=passwordsystemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost

从文档中我们还得到了一些有用信息,这个配置其实就是对jvm环境变量进行设置,本质上是调用了System.setProperty(‘http.proxyHost‘, ‘www.somehost.org‘)。。。。。

为gradle设置proxy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.