简体   繁体   English

无法使用M2Eclipse(0.10.0,使用Maven 3)下载jar

[英]Unable to download jars using M2Eclipse (0.10.0, using Maven 3)

I am using M2Eclipse (0.10.0, Maven 3)in projects. 我在项目中使用M2Eclipse(0.10.0,Maven 3)。 I can add Maven dependency using m2eclipse. 我可以使用m2eclipse添加Maven依赖项。 But dependency jars couldn't be downloaded. 但是依赖项jar无法下载。 Instead, it created a file in each local repo folder named [JAR_Name].jar.lastupdate. 相反,它在每个本地存储库文件夹中创建了一个名为[JAR_Name] .jar.lastupdate的文件。 The content of this file is some thing like : http://[REPO_URL]/central/=1276221188566 该文件的内容类似于:http:// [REPO_URL] / central / = 1276221188566

Even using Maven 3 command line. 即使使用Maven 3命令行。 Jars couldn't be downloaded. Jars无法下载。 Any idea about how could this happen? 关于这怎么发生的任何想法?

First off, the presence of "lastupdated" file is irrelevant. 首先,“ lastupdated”文件的存在无关紧要。 We need to know the debug output (mvn -X dependency:tree). 我们需要知道调试输出(mvn -Xdependency:tree)。 Then you mentioned you were using repository manager and mirroring every request to it - so setup settings.xml according to this guide . 然后,您提到您正在使用存储库管理器并将每个请求镜像到该存储库管理器-因此请根据本指南设置settings.xml。 If you just specified the mirror element with repository manager location and what repositories (URLs) you want to proxy ,(without that profile enabled which is practically changing policy for getting snapshots), you would have something like "central repository disabled" messages in your debug log. 如果您只指定了带有存储库管理器位置和要代理的存储库(URL)的mirror元素(不启用该配置文件,这实际上是更改获取快照的策略),则您的消息中将出现“中央存储库已禁用”之类的消息调试日志。 After you fix it, it should work. 修复后,它应该可以工作。

EDIT: You can always use the URL of group repository from maven settings.xml http://hostname/nexus/content/groups/public + path to the artifact like " org/apache/maven/someartifact/maven-metadata.xml " and see if nexus can proxy the request and serve what you want. 编辑:您可以始终使用来自maven settings.xml http://hostname/nexus/content/groups/public的组存储库的URL以及类似“ org/apache/maven/someartifact/maven-metadata.xml ”等工件的路径并查看nexus是否可以代理该请求并满足您的需求。 If this works, then the reason must be either in maven settings or pom definition. 如果可行,则原因必须是在Maven设置或pom定义中。

I have the same problem. 我也有同样的问题。 Don't know a 'real' solution, but whenever something isn't working I do a scan for .lastUpdated files in my local repo and delete them. 不知道什么是“真正的”解决方案,但是每当无法解决问题时,我都会在本地存储库中扫描.lastUpdated文件并将其删除。 Then things usually work again. 然后事情通常会再次起作用。 (I think that might be due to a badly configured nexus, but unfortunately I don't have access to the nexus config) (我认为这可能是由于错误配置的联系所致,但是很遗憾,我无法访问联系配置)

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

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