IntelliJ Maven/Gradle 代理不工作

IntelliJ Maven/Gradle Proxy isnt working

我用 Robolectric.

设置了一个 Android Gradle 应用程序

我用过这个tutorial

看来工作会。我尝试 运行 测试并收到以下消息:

Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/android-all-4.3_r2-robolectric-0.pom from repository sonatype at https://oss.sonatype.org/content/groups/public/
Error transferring file: Connection refused: connect
[WARNING] Unable to get resource 'org.robolectric:android-all:pom:4.3_r2-robolectric-0' from repository sonatype (https://oss.sonatype.org/content/groups/public/): Error transferring file: Connection refused: connect
Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/android-all-4.3_r2-robolectric-0.pom from repository central at http://repo1.maven.org/maven2
Error transferring file: Connection refused: connect
[WARNING] Unable to get resource 'org.robolectric:android-all:pom:4.3_r2-robolectric-0' from repository central (http://repo1.maven.org/maven2): Error transferring file: Connection refused: connect
Downloading: org/json/json/20080701/json-20080701.pom from repository sonatype at https://oss.sonatype.org/content/groups/public/
Error transferring file: Connection refused: connect
[WARNING] Unable to get resource 'org.json:json:pom:20080701' from repository sonatype (https://oss.sonatype.org/content/groups/public/): Error transferring file: Connection refused: connect
Downloading: org/json/json/20080701/json-20080701.pom from repository central at http://repo1.maven.org/maven2
Error transferring file: Connection refused: connect
[WARNING] Unable to get resource 'org.json:json:pom:20080701' from repository central (http://repo1.maven.org/maven2): Error transferring file: Connection refused: connect
Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.pom from repository sonatype at https://oss.sonatype.org/content/groups/public/
Error transferring file: Connection refused: connect
[WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:pom:1.2' from repository sonatype (https://oss.sonatype.org/content/groups/public/): Error transferring file: Connection refused: connect
Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.pom from repository central at http://repo1.maven.org/maven2
Error transferring file: Connection refused: connect
[WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:pom:1.2' from repository central (http://repo1.maven.org/maven2): Error transferring file: Connection refused: connect
Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar from repository sonatype at https://oss.sonatype.org/content/groups/public/
Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/android-all-4.3_r2-robolectric-0.jar from repository sonatype at https://oss.sonatype.org/content/groups/public/
Downloading: org/json/json/20080701/json-20080701.jar from repository sonatype at https://oss.sonatype.org/content/groups/public/
Error transferring file: Connection refused: connect
Error transferring file: Connection refused: connect
[WARNING] Unable to get resource 'org.json:json:jar:20080701' from repository sonatype (https://oss.sonatype.org/content/groups/public/): Error transferring file: Connection refused: connect
[WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:jar:1.2' from repository sonatype (https://oss.sonatype.org/content/groups/public/): Error transferring file: Connection refused: connect
Downloading: org/json/json/20080701/json-20080701.jar from repository central at http://repo1.maven.org/maven2
Downloading: org/ccil/cowan/tagsoup/tagsoup/1.2/tagsoup-1.2.jar from repository central at http://repo1.maven.org/maven2
Error transferring file: Connection refused: connect
[WARNING] Unable to get resource 'org.robolectric:android-all:jar:4.3_r2-robolectric-0' from repository sonatype (https://oss.sonatype.org/content/groups/public/): Error transferring file: Connection refused: connect
Downloading: org/robolectric/android-all/4.3_r2-robolectric-0/android-all-4.3_r2-robolectric-0.jar from repository central at http://repo1.maven.org/maven2
Error transferring file: Connection refused: connect
[WARNING] Unable to get resource 'org.ccil.cowan.tagsoup:tagsoup:jar:1.2' from repository central (http://repo1.maven.org/maven2): Error transferring file: Connection refused: connect
Error transferring file: Connection refused: connect
Error transferring file: Connection refused: connect
[WARNING] Unable to get resource 'org.robolectric:android-all:jar:4.3_r2-robolectric-0' from repository central (http://repo1.maven.org/maven2): Error transferring file: Connection refused: connect
[WARNING] Unable to get resource 'org.json:json:jar:20080701' from repository central (http://repo1.maven.org/maven2): Error transferring file: Connection refused: connect

Maven 似乎无法连接到任何存储库。

我在 settings.xml 中配置了一个代理,所以它应该可以工作。

有什么想法吗?

问题是我使用了 IntelliJ 提供的 gradle 包装器。我编辑了我安装的 Gradle 版本的 settings.xml。

我将使用过的 gradle 发行版更改为本地安装的发行版,哇。有用。 :)