繁体   English   中英

Eclipse中的Maven依赖

[英]Maven dependency in eclipse

我正在尝试使用Jersey API,这是我的第一个Maven项目。

我有两个看起来像这样的Maven依赖问题:

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  

我应该如何解决这个问题?

从中删除所有失败的下载

对于Windows:

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

然后右键单击Eclipse中的项目,然后选择Maven-> Update Dependencies

可能的解决方案

  1. 删除主文件夹中的仓库,然后使用强制更新快照选项进行构建
  2. 如果无法正常工作,则将错误跟踪中的粘贴链接复制到浏览器中,如果无法使用,则必须在回购主文件夹中创建settings.xml文件,并在使用代理时设置代理

暂无
暂无

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

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