build - gradle 构建失败连接到 https ://repo1. maven.org 被拒绝

标签 build gradle proxy

我正在尝试构建一个包含在 gradle 发行版中的示例项目。当我这样做时 gradle build我收到此错误:

Could not resolve commons-collections:commons-collections:3.2.1.
Required by:
    :application:1.0.2
 > Could not HEAD 'https://repo1.maven.org/maven2/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.pom'.
    > Connection to https://repo1.maven.org refused

我在代理后面工作。我尝试了这里提到的事情:
gradle documentation for proxy configuration但我得到了同样的错误。
你能帮我吗?

最佳答案

使用以下内容在 .gradle 文件旁边添加 gradle.properties 文件:

systemProp.http.proxyHost=www.somehost.org
systemProp.http.proxyPort=8080
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost 

systemProp.https.proxyHost=www.somehost.org
systemProp.https.proxyPort=8080
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost 

关于build - gradle 构建失败连接到 https ://repo1. maven.org 被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30526575/

相关文章:

node.js - 使用 nginx 应用程序在基本 url 上运行 NodeJs Express 应用程序

Go构建错误 "go: no matching versions for query "最新“”

添加新库后,Android Studio 构建速度变慢?

java - GWT 接口(interface)问题 : Breaking on exception: TypeError: Cannot read property 'getRestWrapper' of undefined

sql-server - 如何在我的开发机器上模拟网络延迟?

windows - 在 HTTP 代理下工作时 Windows 上的 SSH 配置

ios - Xcode 构建成功但未在 iPhone/模拟器上运行

swift - 终端上的 `swift build` 抛出 `error: root manifest not found`

c++程序无法在另一台PC上运行并出现libgcc错误

java - 在IntelliJ IDEA中运行Gradle测试时的"No tests found for given includes"