简体   繁体   English

maven问题ArtifactDescriptorException

[英]maven issue ArtifactDescriptorException

I am trying the Spring REST example exaplained here . 我正在尝试将Spring REST示例放在这里 The project source is here here . 项目来源在这里

I unzipped the file and renamed top folder to 'myproject' and imported it into eclipse as an existing maven project. 我解压缩文件并将顶级文件夹重命名为'myproject'并将其作为现有的maven项目导入eclipse。 But, observed that lot of compilation issues due to missing spring jars. 但是,由于缺少春季罐子,观察到很多编译问题。 I guess this is because maven is not able to import these jars. 我想这是因为maven无法导入这些罐子。 When I check the pom.xml, I see eclipse is complaining with below errors: 当我检查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

and

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

I am new to maven so struggling here. 我是maven的新手,所以在这里挣扎。 Please help me how to fix it. 请帮我解决一下。

Thank you. 谢谢。

For me, it was because Eclipse was caching the exception. 对我来说,这是因为Eclipse正在缓存异常。 Try to: 尝试:

right click on project -> maven -> update-project -> force to update snapshot/release -> OK. 右键单击项目 - > maven - > update-project - >强制更新快照/发布 - >确定。

It worked for me for the same problem. 它对我来说也是同样的问题。

try this helped me 试试这对我有帮助

right click on project -> maven -> update-project -> force to update snapshot/release -> OK. 右键单击项目 - > maven - > update-project - >强制更新快照/发布 - >确定。

Can you try with dependency like : 你可以尝试依赖:

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.2.3</version>

And try to run your Maven application using -U flag. 并尝试使用-U标志运行您的Maven应用程序。

The simplest solution is to remove the following folder within your local repository ${HOME}/.m2/repository/com/fasterxml/jackson and retry your build. 最简单的解决方案是删除本地存储库${HOME}/.m2/repository/com/fasterxml/jackson中的以下文件夹,然后重试您的构建。

If it continues not to work you have to check if you have proxy between your computer and Maven central or if you have any network issues. 如果它继续不起作用,您必须检查您的计算机和Maven Central之间是否有代理,或者您是否有任何网络问题。

I had a similiar problem with the same message! 我对同一条消息有一个类似的问题!

The problem was that Eclipse (4.4 Luna) did not have the correct maven settings. 问题是Eclipse(4.4 Luna)没有正确的maven设置。

What helped me was: 帮助我的是:

Window > Preferences > Maven > User Settings > User Settings

Delete the %USERHOME% statement (or similar), type in the full path of your settings.xml and click on Update Settings , then maven update your projects again 删除%USERHOME%语句(或类似名称),键入settings.xml的完整路径并单击“ 更新设置” ,然后再次更新项目

Cheers! 干杯!

I had a similar issue after Proxy was disabled in my Company network. 在我的公司网络中禁用代理后,我遇到了类似的问题。 After removing in .m2/settings.xml <proxies> section, dependencies were updated properly. .m2/settings.xml <proxies>部分中删除后,依赖关系已正确更新。 Please check, may be this is also your case. 请检查,可能这也是你的情况。

I had same issue while downloading "spring-boot-starter-hateoas" dependancy. 下载“spring-boot-starter-hateoas”依赖时我有同样的问题。 The solution that worked for me was, upgrade "spring-boot-starter-parent" to Version 1.4.0.RELEASE (mine was 1.3.3 previously). 对我有用的解决方案是,将“spring-boot-starter-parent”升级到版本1.4.0.RELEASE(之前我的是1.3.3)。 Just for the reference : <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>**1.4.0.RELEASE**</version> </parent> 仅供参考: <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>**1.4.0.RELEASE**</version> </parent>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM