无法使用M2Eclipse下载jar(0.10.0,使用Maven 3) [英] Unable to download jars using M2Eclipse (0.10.0, using Maven 3)

查看:236
本文介绍了无法使用M2Eclipse下载jar(0.10.0,使用Maven 3)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在项目中使用M2Eclipse(0.10.0,Maven 3)。我可以使用m2eclipse添加Maven依赖关系。但依赖jar无法下载。相反,它在名为[JAR_Name] .jar.lastupdate的每个本地repo文件夹中创建了一个文件。这个文件的内容是这样的:
http:// [REPO_URL] / central / = 1276221188566



甚至使用Maven 3命令行。 Jars无法下载。任何关于如何发生这种情况的想法?

解决方案

首先,lastupdated文件的存在是无关紧要的。我们需要知道调试输出(mvn -X dependency:tree)。然后你提到你正在使用存储库管理器并镜像每个请求 - 所以根据这个设置settings.xml 指南。如果您刚刚指定了具有存储库管理器位置的镜像元素和要代理的存储库(URL)(没有启用实时更改快照策略的配置文件),您将会在调试日志。修复它后,它应该工作。



编辑:您可以随时使用maven settings.xml中的组存储库的URL http:// hostname / nexus / content / groups / public +工件的路径,如 org / apache / maven / someartifact / maven-metadata.xml 并查看nexus是否可以代理请求并提供所需的内容。如果这样做,那么原因必须在maven设置或pom定义中。


I am using M2Eclipse (0.10.0, Maven 3)in projects. I can add Maven dependency using m2eclipse. But dependency jars couldn't be downloaded. Instead, it created a file in each local repo folder named [JAR_Name].jar.lastupdate. The content of this file is some thing like : http://[REPO_URL]/central/=1276221188566

Even using Maven 3 command line. Jars couldn't be downloaded. Any idea about how could this happen?

解决方案

First off, the presence of "lastupdated" file is irrelevant. We need to know the debug output (mvn -X dependency:tree). Then you mentioned you were using repository manager and mirroring every request to it - so setup settings.xml according to this guide . 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. 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. If this works, then the reason must be either in maven settings or pom definition.

这篇关于无法使用M2Eclipse下载jar(0.10.0,使用Maven 3)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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