IntelliJ IDEA首选项设置 No proxy
,让我重复 No proxy
,但是同步gradle时,我发现gradle仍然采用了代理设置,没有在开玩笑
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
我怎么知道gradle正在使用代理,让我们看看
***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
什么是127.0.0.1:1087,这是我的本地代理服务器shadowsocks客户端代理,我曾经优先进行设置来获取被防火墙挡住的东西,但是这次,我设置了 {{1 }} ,我也调查了环境变量,以了解是否存在环境依赖性,但是环境中也没有此类代理设置,我只想在环境中设置 No proxy
应该尊重偏好,为什么这么难?
答案 0 :(得分:1)
当您在intellij IDEA中添加代理时,它会自动在gradle.properties
中添加代理,但是当您从设置中删除它时,它仍然存在。打开gradle.properties
并删除代理。
应该是这样的:
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
可以放置3个位置gradle.properties
(如果在多个位置配置了一个选项,则最后一个将获胜)
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)
您可以详细了解here