简体   繁体   English

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

[英]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.

相关问题 如何解决 Could not find artifact javax.xml.bind:jaxb-api:pom:2.3.0-b161121.1438 in central (https://repo1.maven.org/maven2)? - How do I resolve Could not find artifact javax.xml.bind:jaxb-api:pom:2.3.0-b161121.1438 in central (https://repo1.maven.org/maven2)? 经典错误:无法更新central | http://repo1.maven.org/maven2的索引 - Classic error: Unable to update index for central|http://repo1.maven.org/maven2 如何解决与 Maven 中央存储库的连接超时? - How resolve connection time out to maven central repository? Maven 错误无法传输工件 org.apache.maven.plugins:maven-source-plugin:pom:3.0。 - Maven Errror Could not transfer artifact org.apache.maven.plugins:maven-source-plugin:pom:3.0.1 from/to central 无法将工件 org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 从/到中央 (http://repo1.Z402C5D9AF6B270711EAZD70BEE574) - Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 from/to central (http://repo1.maven.org/maven2) 使用子模块发布到Maven Central - Release to Maven Central with submodules Maven Central中的Web资源 - Web resources in Maven Central 无法从Maven Central编译项目 - Unable to compile project from Maven Central 独立的jar和Maven Central - Standalone jar and maven central Maven多项目未正确部署到Maven Central - Maven Multi-Project is not Deployed Correctly to Maven Central
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM