Gradle-下载依赖项时间歇性地获取套接字关闭异常

时间:2018-11-27 13:06:21

标签: maven gradle nexus

当我从Gradle中从Maven存储库下载依赖项时,我收到了套接字关闭的异常

Could not download asm-all-repackaged.jar (org.glassfish.hk2.external:asm-all-repackaged:2.5.0-b32)
  > Could not get resource 'https://nexus.internal/nexus/content/groups/mirror/org/glassfish/hk2/external/asm-all-repackaged/2.5.0-b32/asm-all-repackaged-2.5.0-b32.jar'.
     > Could not GET 'https://nexus.internal/nexus/content/groups/mirror/org/glassfish/hk2/external/asm-all-repackaged/2.5.0-b32/asm-all-repackaged-2.5.0-b32.jar'.
        > Socket closed

似乎资源已下载,但是Gradle构建突然结束并出现错误。当我尝试像gradle build || while [[ $? != 0 ]]; do gradle build; done这样循环运行作业时,我最终会获得成功的作业。

知道为什么会这样吗?

------------------------------------------------------------
Gradle 4.0
------------------------------------------------------------

Build time:   2017-06-14 15:11:08 UTC
Revision:     316546a5fcb4e2dfe1d6aa0b73a4e09e8cecb5a5

Groovy:       2.4.11
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_191 (Oracle Corporation 25.191-b12)
OS:           Mac OS X 10.14.1 x86_64

1 个答案:

答案 0 :(得分:0)

最后,我放弃并重新安装了整个OSX,这似乎解决了问题。

但是我不明白,我重新安装了每个Java,删除了与JDK,Gradle,Maven相关的所有内容,但没有任何帮助。