本地REPO中的Maven依赖项具有.lastUpdated扩展名 [英] Maven dependencies in local REPO have .lastUpdated extension

查看:131
本文介绍了本地REPO中的Maven依赖项具有.lastUpdated扩展名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在本地存储库中安装Maven项目时,我注意到pomjar文件具有.lastUpdated扩展名.由于这个问题,我无法建立依赖它的项目.

When I try to to install maven project in local repository, I notice that pom and jar files have .lastUpdated extension. Because of this issue I cannot build my project which depends on it.

您能解释一下为什么会发生吗?

Could you please explain why it happens?

推荐答案

我找到了答案 当无法下载工件时,Maven 3将这个结果缓存在〜/.m2/repo/.../.lastUpdated"文件中,以备将来参考.对于未找到"情况,似乎可以将HTTP代码用于更精细地重新尝试检索,而不仅仅是缓存故障. 例如,对于任何404,我都同意,结果应缓存失败并要求-U尝试再次检索它.但是,对于400、500、501、502、503、301、302(今天3xx的Maven行为是什么?)我认为解析引擎应该每次都尝试重新获取工件.使用这些错误代码,似乎更有可能是配置问题或短暂的网络故障,而不是该存储库中没有文件之一.但是,短暂的网络故障会造成长期的缓存隐患,因为永远不会尝试再次检索该文件.

When an artifact is unable to be downloaded, Maven 3 caches this result for future reference in the "~/.m2/repo/.../.lastUpdated" file. For "not found" situations, it seems that the HTTP code could be used to more granularly re-attempt retrieval rather than just cache the failure. For example, for any 404, I agree, the result should cache the failure and require a -U to attempt to retrieve it again. However, for 400, 500, 501, 502, 503, 301, 302 (what's the Maven behavior for 3xx today?) I think the resolution engine should try to re-retrieve the artifact each time. With those error codes, it seems more likely a config issue or brief network hiccup, not one of the file being absent from that repo. However, that brief network hiccup has longstanding cache implications in that the file is never attempted to be retrieved again.

这篇关于本地REPO中的Maven依赖项具有.lastUpdated扩展名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆