Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ HTTP-Proxy works but fails at gradle dependencies

so currently at work I face the problem, that I cannot build projects, which use global dependencies. We use an auto-config proxy script, which I already set in the File->Settings->Appearance & Behaviour->System Settings->HTTP Proxy and tested with the Check Connection-function.

The check connection function is working for any arbitrary html and also for the needed gradle-file (jcenter.bintray.com/com/android/tools/build/gradle/2.0.0/gradle-2.1.0-javadoc.jar).

For solutions I already tried to:

  • set the Proxy Information into the gradle.properties
  • tried to set http and/or https proxy settings

    * systemProp.http(s).proxyHost=linktoproxyconfig.org  
    * systemProp.http(s).proxyPort=xxxx                 
    * systemProp.http(s).proxyUser=xxxx            
    * systemProp.http(s).proxyPassword=xxxx
    
  • changing the repository direction (jcenter() vs. jcenter{url http://jcenter.bintray.com}

I am aware of the fact, that one can work offline, downloading the gradle locally. But to prevent the additional maintenance of gradle versions on different machines I would like to restrain from the work offline option.

Edit: Maybe I should also add the error message:
Gradle sync failed: Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.

I would be most grateful if someone has an idea about a solution.

like image 942
sasuchi Avatar asked Jun 08 '16 13:06

sasuchi


1 Answers

IntelliJ IDEA 2017.3 does not seem to respect the proxy options for downloading Gradle. So add the proxy options to both gradle.properties and gradle-wrapper.properties, and then run ./gradlew in a terminal. This will download Gradle. After that, IntelliJ will work.

like image 122
Robin Green Avatar answered Sep 20 '22 23:09

Robin Green