Maven3 无法从远程存储库获取最新的工件快照版本
我已经面临这个错误有一段时间了。 由于无法准确追溯时间,我感觉可以追溯到切换到maven3之后。
发生的情况如下:
- 我将artifact-SNAPSHOT从服务器部署到Artifactory实例,
- 我在依赖于artifact-SNAPSHOT的本地项目上强制进行快照更新,
它不起作用,我可能会收到编译错误,显示artifact-SNAPSHOT不是最新的。
我必须删除artifact-SNAPSHOT 的本地存储库版本,或者获取最新的源并执行artifact-SNAPSHOT 的本地“mvn install”。
有人面临这个问题吗? 这是一个已知的错误吗? 如果没有,我可以检查什么来准确了解发生了什么?
干杯
I've been facing this error fro quite a while now.
Without being able to trace it back in time precisely, I feel it dates back from the switch to maven3.
Here's what happens:
- I deploy artifact-SNAPSHOT from a server to an Artifactory instance
- I force snapshot update on my local project that depends on artifact-SNAPSHOT
it doesn't work, I may get compilation error that shows the artifact-SNAPSHOT isn't the lastest one.
I have to either delete the local repo version of artifact-SNAPSHOT or get the lastest source and do a local 'mvn install' of artifact-SNAPSHOT.
Anyone facing the problem?
Is it a known bug?
If not, what could I check to understand exactly what happens?
cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个错误。 这是一个链接。
如果您已经在 module-A (1.2.3-SNAPSHOT) 上工作了一段时间并且已经运行:
这会导致您的本地存储库的元数据“锁定”工件,这意味着它不会再像它认为的那样被更新你还在努力。因此,如果几天后您开始处理依赖于 module-A:1.2.3-SNAPSHOT 的 module-B,并且远程存储库中安装了较新的版本, version 将完全被忽略。因此,您必须首先删除包含此依赖项的本地目录,然后
再次执行以下操作。传递
-U
根本没有帮助(这实际上是自然的事情)。This is a bug. Here is a link.
If you have worked on module-A (1.2.3-SNAPSHOT) for a while and you've run:
This causes your local repository's metadata to 'lock' the artifact, meaning that it won't get updated anymore, as it thinks you're still working on it. So, if, let's say, in a couple of days you start working on module-B which depends on module-A:1.2.3-SNAPSHOT and there is a newer version installed in the remote repository, that version will completely be ignored. Thus, you'll have to remove the local directory that contains this dependency first and then do:
all over again. Passing the
-U
doesn't help at all (which would actually be the natural thing to do).是这个错误吗:http://jira.codehaus.org/browse/MNG-4987 ? ->使用maven 3.0.3
Is it this bug: http://jira.codehaus.org/browse/MNG-4987 ? -> use maven 3.0.3