m2eclipse 的问题——无法从 Archiva 下载 Maven 工件——改为获取 .lastUpdated 文件
我正在使用基于 Eclipse 3.6 (Helios) 的 STS 2.5.2 和内置 m2eclipse 0.10.0。我还使用 Archiva 作为我的“远程”存储库管理器(它托管在同一台计算机上)。
我更改了 Maven 配置设置文件,将我的 Archiva 实例指定为 * 的镜像,并且 Archiva 也是 Central 的代理。在我的所有 pom 中,我已将 Archiva 内部存储库指定为存储库和插件存储库。
设置是这样的,当 Maven 命令行 (CLI) 请求工件(例如 junit:junit:3.8.1:jar)时,请求将发送到 Archiva,Archiva 反过来从 Central 检索该工件(如果它还没有) ,然后将其提供给 Maven CLI。
这对于 Maven CLI 来说一切正常。我的问题是,当从 Eclipse 构建我的项目时,m2eclipse 无法从 Archiva 下载某些工件。相反,我只得到可怕的 .lastUpdated 文件(pom 和 jar)。尽管这些文物都在档案馆中。对于大多数工件,只有 Archiva 中的某些工件不会发生此错误,例如 org.apache.maven.doxia:doxia-sink-api:1.0-alpha-9:jar,它依赖于我的一个项目依赖关系。我尝试从 Archiva 中删除有问题的工件,删除我的 .m2 存储库并重建,但问题仍然存在。
有什么想法吗?这是记录在案的 m2eclipse 错误吗?作为解决方法,我创建了一个特殊的子模块,它除了从 Maven CLI 的 Archive 下载缺少的工件之外什么也不做。
提前致谢,
史蒂夫所罗门
I'm using STS 2.5.2 based on Eclipse 3.6 (Helios) with built-in m2eclipse 0.10.0. I'm also using Archiva as my "remote" repository manager (it's hosted on the same machine).
I've changed my Maven config settings file to specify my Archiva instance as a mirror of *, and Archiva is also a proxy of Central. In all of my pom's I've specified my Archiva internal repository as both a repository and a plug-in repository.
The setup is such that when Maven command line (CLI) requests an artifact, for example junit:junit:3.8.1:jar, the request goes to Archiva, which in turn retrieves the artifact from Central if it doesn't already have it, then serves it to Maven CLI.
This all works fine for Maven CLI. My problem is that when building my project from Eclipse, m2eclipse is unable to download certain artifacts from Archiva. Instead, I get the dreaded .lastUpdated files (pom and jar) only. Even though the artifacts are in Archiva. This error doesn't happen for the majority of artifacts, just certain artifacts in Archiva, for example org.apache.maven.doxia:doxia-sink-api:1.0-alpha-9:jar, which is a dependency on one of my project dependencies. I've tried removing the offending artifacts from Archiva, deleting my .m2 repository, and rebuilding, but the problem persists.
Any ideas? Is this a documented m2eclipse bug? As a workaround, I've created a special sub-module that does nothing but downloads the missing artifacts from Archive from Maven CLI.
Thanks in advance,
Steve Solomon
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用artifactory 并在指定错误的URL 时收到.lastUpdated 文件。为了解决这个问题,我使用 -X 选项运行 mvn ,发现它没有从我期望下载的存储库中下载 jar。
我猜如果您指定了不正确的工件,无论是名称还是版本,您也会遇到问题。
I use artifactory and received the .lastUpdated file when the wrong URL was specified. To troubleshoot this I ran mvn with the -X option and saw that it was not downloading the jar from the repository I was expecting to be downloaded from.
I'm guessing you would also have problems if you specified an incorrect artifact, weather it be the name or the version.
在这种情况下,最好的做法是删除附加了 .lastUpdated 的工件。并运行 mvn -U (强制更新开关 -U )
The best thing to do in this scenario would be to delete artifacts which have .lastUpdated appended to it. And run mvn -U (force update switch -U )