maven issue ArtifactDescriptorException

2019-04-19 23:18发布

I am trying the Spring REST example exaplained here. 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. 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. When I check the pom.xml, I see eclipse is complaining with below errors:

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. Please help me how to fix it.

Thank you.

7条回答
神经病院院长
2楼-- · 2019-04-19 23:54

I had a similiar problem with the same message!

The problem was that Eclipse (4.4 Luna) did not have the correct maven settings.

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

Cheers!

查看更多
登录 后发表回答