Gradle installation having a proxy issue

前端 未结 2 658
悲哀的现实
悲哀的现实 2020-12-11 03:55

I\'m running into issues building android projects on a server in a corporate network behind a proxy on Jenkins. Have tried with both the jenkins gradle, as well as gradlew.

相关标签:
2条回答
  • 2020-12-11 04:33

    For me the issue was the http prefix! If this is your case, remove http/https prefixes!

    I had my gradle.properties like this, and was failing:

    systemProp.http.proxyHost=http://squid.proxy.com
    systemProp.http.proxyPort=8080
    systemProp.https.proxyHost=http://squid.proxy.com
    systemProp.https.proxyPort=8080
    

    Proper way to set proxy settings for gradle is:

    systemProp.http.proxyHost=squid.proxy.com
    systemProp.http.proxyPort=8080
    systemProp.https.proxyHost=squid.proxy.com
    systemProp.https.proxyPort=8080
    
    0 讨论(0)
  • 2020-12-11 04:33

    You have to add the following configuration in gradle.configuration.These are the proxy settings needed to be configured if you are working behind proxy.

    Source: (https://docs.gradle.org/current/userguide/build_environment.html#sec:accessing_the_web_via_a_proxy)

    And don't add 'http.// or 'https:' in systemProp.http.proxyHost only 'www.host.com' .Also comment out the systemProp.http.proxyUser or proxypassword if you don't need it to login into the proxy.

    systemProp.proxySet=true
    systemProp.http.keepAlive=true
    systemProp.http.proxyHost=www.host.com
    systemProp.http.proxyPort=port
    systemProp.http.proxyUser=username_ifneeded
    systemProp.http.proxyPassword=password_needed
    systemProp.http.nonProxyHosts=local.net|some.host.com
    
    systemProp.https.keepAlive=true
    systemProp.https.proxyHost=host
    systemProp.https.proxyPort=port
    systemProp.https.proxyUser=username_ifneeded
    systemProp.https.proxyPassword=password_ifneeded
    systemProp.https.nonProxyHosts=local.net|some.host.com
    
    0 讨论(0)
提交回复
热议问题