0

IntelliJ IDEA preference setting No proxy, let me repeat No proxy, but sync gradle, I found gradle still took proxy setting, No kidding.

IntelliJ IDEA 2019.1.3 (Ultimate Edition)
Build #IU-191.7479.19, built on May 28, 2019
Licensed to IntelliJ IDEA Evaluator
Expiration date: August 19, 2019
JRE: 1.8.0_202-release-1483-b58 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.14.5

How do I know gradle is using proxy, let's see

***VERT LONG LONG STACK BACKTRACE***
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to 127.0.0.1:1087 [/127.0.0.1] failed: Connection refused (Connection refused)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:159)
    ... 190 more
Caused by: java.net.ConnectException: Connection refused (Connection refused)
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    ... 202 more

what is 127.0.0.1:1087, that is my local proxy server shadowsocks client agent, I once did the setting in preference for fetching things blocked by our great fire wall, but THIS TIME, I set No proxy in preference, also I investigated environment variables in case of env dependency things, but there is not such proxy setting in env either, I just want the No proxy setting in preference should be honored, why is that so hard?

http8086
  • 778
  • 8
  • 18
  • Do you have set it for Gradle? https://stackoverflow.com/a/52151572/104891 – CrazyCoder Jul 25 '19 at 18:22
  • Yes, there is, actually there is gradle.properties in ~/.gradle/ directory, I only noticed there is no such file in project, didn't aware such thing before, thank you so much – http8086 Jul 26 '19 at 03:02

1 Answers1

1

When you add proxy in the intellij IDEA it automatically adds the proxy in gradle.properties but when you remove it from settings it's still there. open gradle.properties and remove the proxy.

It should be something like this:

systemProp.http.proxyHost=your_proxy_http_host
systemProp.http.proxyPort=your_proxy_http_port
systemProp.https.proxyHost=your_proxy_https_host
systemProp.https.proxyPort=your_proxy_https_port

There are 3 places gradle.properties can be placed (if an option is configured in multiple locations the last one wins)

gradle.properties in Gradle installation directory.

gradle.properties in project root directory.

gradle.properties in GRADLE_USER_HOME directory. (if you did not set GRADLE_USER_HOME in your environment variable, the default is USER_HOME/.gradle)

You can read more about it here

Habib Kazemi
  • 1,706
  • 1
  • 18
  • 26
  • 1
    thank you, actually for me, gradle beginner , do not forget there is gradle.properties in ~/.gradle directory, you can mention that point out there, thank you – http8086 Jul 26 '19 at 03:04