我正在尝试构建一个包含在 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/