[Maven]添加新仓库或者新发布依赖后却获取不到问题的解决方案

当在Maven项目中添加新仓库或发布依赖后,如果遇到仍无法获取到依赖的问题,可能是由于缓存未更新。通过在命令行中使用 `-U` 参数或在Eclipse的Run Configuration中勾选 `Update Snapshots`,可以强制Maven重新从仓库下载依赖,从而解决找不到依赖文件的错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

tags: maven

[ERROR] Failed to execute goal on project settings: Could not resolve dependencies for project com.netease.mail:settings:war:1.0.0: The following artifacts could not be resolved: newbee:cmproxy:jar:1.0-45241, toolbox:cache-annotations:jar:1.1.27406.0, toolbox:mailsender:jar:1.1.0, newbee:ntescode:jar:1.0.21214.0, netease:dfs:jar:1.0: Failure to find newbee:cmproxy:jar:1.0-45241 in http://192.168.33.234/nexus/content/groups/public/ was cached in the local repository, 

resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project settings: Could not resolve dependencies for project com.netease.mail:settings:war:1.0.0: The following artifacts could not be resolved: newbee:cmproxy:jar:1.0-45241, toolbox:cache-annotations:jar:1.1.27406.0, toolbox:mailsender:jar:1.1.0, newbee:ntescode:jar:1.0.21214.0, netease:dfs:jar:1.0: Failure to find newbee:cmproxy:jar:1.0-45241 in http://192.168.33.234/nexus/content/groups/public/ was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced

已经将第三方依赖jar部署到私有仓库,但是在更新应用依赖时,仍然报找不到依赖文件。最终要的提示信息为上日志中间的那个提示:

resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]

类似与缓存未清理或者last-visit这种提示信息。如何强制要求从私有仓库进行尝试获取依赖文件呢?
参考了Nexus添加新Repository后Maven仍找不到jar包的解决方案

命令行下:其中提到了使用-U参数(-U,--update-snapshots Forces a check for updated releases and snapshots on remote repositories),

Eclipse中:在eclipse Run Configuration中勾选Update Snapshots,再run后依赖可以获取。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值