Build gradle生成失败连接到https://repo1.maven.org 拒绝

Build gradle生成失败连接到https://repo1.maven.org 拒绝,build,gradle,proxy,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

我正在尝试构建一个包含在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文件旁边添加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 

您可能需要添加systemProp.http.proxyUser=my\u user\u name systemProp.http.proxyPassword=my\u secret\u password。。。systemProp.https.proxyUser=my\u user\u name systemProp.https.proxyPassword=my\u secret\u password。 此外,对于Windows计算机,gradle.properties文件位于C:\Documents and Settings\myAccount\.gradle\gradle.properties中。并检查是否有一个“GRADLE\u USER\u HOME”环境变量指向C:\Documents And Settings\myAccount\.GRADLE