简体   繁体   中英

Maven dependency in eclipse

I am trying to use jersey API and this is my first maven project.

I have 2 maven dependency problems that look like this:

Description Resource    Path    Location    Type
ArtifactTransferException: Failure to transfer org.glassfish.hk2:osgi-resource-locator:jar:1.0.1 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 org.glassfish.hk2:osgi-resource-locator:jar:1.0.1 from/to central (http://repo.maven.apache.org/maven2)

Description Resource    Path    Location    Type
Missing artifact org.glassfish.hk2:osgi-resource-locator:jar:1.0.1  

How should I go about to fix this?

Remove all your failed downloads from

For windows:

cd %userprofile%\.m2\repository
for /r %i in (*.lastUpdated) do del %i

Then rightclick on your project in eclipse and choose Maven->Update Dependencies

Possible solutions

  1. Delete your repo in home folder then build with force Update Snapshot option
  2. Copy paste link in error trace into your browser if didnt work you have to create settings.xml file in your repo home folder and set proxy if you are using them

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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