繁体   English   中英

如何解决Maven项目中的central.maven.org:未知主机central.maven.org?

[英]How to resolve central.maven.org: Unknown host central.maven.org in Maven Project?

请找到以下日志:

[ERROR] Failed to execute goal on project hospital: Could not resolve dependencies for project 
com.project_name.test.web:hospital:war:0.0.1-SNAPSHOT: Failed to collect dependencies at 
com.example.test:example-child:jar:1.1.12-SNAPSHOT: Failed to read artifact descriptor for 
com.example.test:example-child:jar:1.1.12-SNAPSHOT: Could not transfer artifact 
com.example.test:example-parent:pom:1.1.12-SNAPSHOT from/to maven-central
(http://central.maven.org/maven2/): central.maven.org: Unknown host central.maven.org -> [Help 1]

提前致谢!

这可能是由于之前下载的工件(在我的情况下为.m2/repository/org/geotools/geotools/19.1/geotools-19.1.pom)包含此作为特定存储库,甚至可能从第三方存储库中检索到的。

检查您的本地工件以获取对存储库的引用,例如通过这种蛮力方法:

grep -nr "central.maven.org" ~/.m2/repository/

替换/删除依赖项解决了这个问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM