如何防止gradle在IntelliJ IDEA中使用代理?

如何防止gradle在IntelliJ IDEA中使用代理?,gradle,intellij-idea,Gradle,Intellij Idea,IntelliJ IDEA首选项设置无代理,让我重复一下无代理,但是同步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-148

IntelliJ IDEA首选项设置
无代理
,让我重复一下
无代理
,但是同步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客户端代理,我曾经为获取被我们长城阻止的东西做过优先设置,但这次,我优先设置了
无代理
,并且我还调查了环境变量,以防环境依赖的事情,但是env中也没有这样的代理设置,我只是希望首选的
没有代理设置应该得到尊重,为什么这么难呢?

当您在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。可以放置属性
(如果在多个位置配置了选项,则最后一个位置获胜)


您可以阅读更多有关它的信息

您是否已将其设置为Gradle?是的,有,实际上在~/.gradle/目录中有gradle.properties,我只注意到项目中没有这样的文件,以前没有意识到这样的事情,非常感谢你,实际上对我来说,gradle初学者,不要忘了~/.gradle目录中有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)