gpt4 book ai didi

java - maven 问题 ArtifactDescriptorException

转载 作者:IT老高 更新时间:2023-10-28 13:58:34 26 4
gpt4 key购买 nike

我正在尝试解释的 Spring REST 示例 here .项目源码在这里here .

我解压缩了文件并将顶层文件夹重命名为“myproject”,并将其作为现有的 maven 项目导入到 eclipse 中。但是,观察到由于缺少 Spring jar 而导致的许多编译问题。我想这是因为 maven 无法导入这些 jar。当我检查 pom.xml 时,我看到 eclipse 提示以下错误:

ArtifactDescriptorException: Failed to read artifact descriptor for com.fasterxml.jackson.core:jackson-databind:jar:2.2.2: ArtifactResolutionException: Failure to transfer com.fasterxml.jackson.core:jackson-databind:pom:2.2.2 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact com.fasterxml.jackson.core:jackson-databind:pom:2.2.2 from/to central (http://repo.maven.apache.org/maven2): connection timed out to http://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.2.2/jackson-databind-2.2.2.pom

ArtifactDescriptorException: Failed to read artifact descriptor for com.fasterxml.jackson.core:jackson-databind:jar:2.2.2: ArtifactResolutionException: Failure to transfer com.fasterxml.jackson.core:jackson-databind:pom:2.2.2 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact com.fasterxml.jackson.core:jackson-databind:pom:2.2.2 from/to central (http://repo.maven.apache.org/maven2): connection timed out to http://repo.maven.apache.org/maven2/com/fasterxml/jackson/core/jackson-databind/2.2.2/jackson-databind-2.2.2.pom

我是 maven 的新手,所以在这里苦苦挣扎。请帮我解决它。

谢谢。

最佳答案

对我来说,这是因为 Eclipse 正在缓存异常。尝试:

右键单击项目 -> maven -> update-project -> 强制更新快照/发布 -> 确定。

同样的问题对我有用。

关于java - maven 问题 ArtifactDescriptorException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19246860/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com