每次我构建项目时,它总是显示一些这样的警告
[WARNING] Could not transfer metadata {one of our own snapshot lib}/maven-metadata.xml from/to repository.jboss.org (http://repository.jboss.org/nexus/content/groups/public/): Connect to repository.jboss.org:443 [repository.jboss.org/209.132.182.97] failed: Connection timed out (Connection timed out)
[INFO] Downloading: https://maven.java.net/content/repositories/xxx/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: https://repository.apache.org/content/repositories/xxx/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloading: http://snapshots.repository.codehaus.org/xxx/1.0.0-SNAPSHOT/maven-metadata.xml
我们通常最终都能构建成功,但有时会阻塞构建进度一小时或更长时间。
有趣的是,这个lib是我们自己的nexus服务器中自己的lib,但maven总是尝试从其他第三方存储库下载其元数据。
我应该做什么?
最佳答案
您可能在 settings.xml
中指定了 jboss 存储库,但由于某种原因您无法连接到该存储库。如果您的 settings.xml
没有镜像条目,它也可能来自 POM 文件。
此外,jboss 存储库可能位于内部存储库之前,因此 Maven 会首先尝试查找内部存储库。
最好的办法通常是通过公司 Nexus 服务器管理所有外部存储库,并在 setting.xml
中指向该存储库。
关于java - maven构建时如何阻止从其他存储库下载metadata.xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58585555/