[英]How to resolve central.maven.org: Unknown host central.maven.org in Maven Project?
Please find the below logs:请找到以下日志:
[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]
Thanks in advance!提前致谢!
This failes likely due to an artifact downloaded earlier (in my case.m2/repository/org/geotools/geotools/19.1/geotools-19.1.pom) containing this as a specific repo, maybe even retrieved from a thirdparty repo.这可能是由于之前下载的工件(在我的情况下为.m2/repository/org/geotools/geotools/19.1/geotools-19.1.pom)包含此作为特定存储库,甚至可能从第三方存储库中检索到的。
Check your local artifacts for references to the repository, eg by this brute force approach:检查您的本地工件以获取对存储库的引用,例如通过这种蛮力方法:
grep -nr "central.maven.org" ~/.m2/repository/
Replacing/removing the dependency solved the issue.替换/删除依赖项解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.