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

gradle build failure Connection to https://repo1.maven.org refused

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