我正在尝试Spring REST示例,解释为here。该项目的源代码在这里here。
我解压了这个文件,将top文件夹重命名为'myproject‘,并将其作为一个现有的maven项目导入到eclipse中。但是,观察到由于缺少spring jars而导致的许多编译问题。我猜这是因为maven不能导入这些jars。当我检查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,所以在这里很艰难。请告诉我怎么修。
谢谢。
发布于 2014-04-04 14:01:48
对我来说,这是因为Eclipse缓存了异常。尝试:
右击项目-> maven -> update -项目->强制更新快照/发布-> OK。
它对我来说也适用于同样的问题。
发布于 2016-02-23 02:41:19
试试这个对我有帮助
右击项目-> maven -> update -项目->强制更新快照/发布-> OK。
发布于 2013-10-08 19:48:47
您是否可以尝试使用依赖关系,如:
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.2.3</version>
并尝试使用-U标志运行您的Maven应用程序。
https://stackoverflow.com/questions/19246860
复制相似问题