maven issue ArtifactDescriptorException

2022-09-04 07:48:35

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

我解压缩了文件并将顶部文件夹重命名为“myproject”,并将其作为现有的maven项目导入eclipse。但是,观察到由于缺少弹簧罐而导致的许多编译问题。我想这是因为maven无法导入这些罐子。当我检查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

我是新手,所以在这里挣扎。请帮我如何解决它。

谢谢。


答案 1

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

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

它对同样的问题对我有用。


答案 2

试试这个帮助了我

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


推荐