Java 无法使用 maven 依赖项下载 m2 存储库中的 .jar 文件
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22297963/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Unable to download .jar files inside m2 repository using maven dependencies
提问by Prashanth Sams
This is the error thrown,
这是抛出的错误,
Failure to transfer org.codehaus.plexus:plexus-utils:jar:3.0 from http://mirrors.ibiblio.org/maven2was cached in the local repository, resolution will not be reattempted until the update interval of ibiblio.org has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.plexus:plexus-utils:jar:3.0 from/to ibiblio.org (http://mirrors.ibiblio.org/maven2): Access denied to http://mirrors.ibiblio.org/maven2/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar. Error code 403, Forbidden
从http://mirrors.ibiblio.org/maven2传输 org.codehaus.plexus:plexus-utils:jar:3.0 失败 已缓存在本地存储库中,直到 ibiblio.org 的更新间隔已过,才会重新尝试解析或强制更新。原始错误:无法将工件 org.codehaus.plexus:plexus-utils:jar:3.0 from/to ibiblio.org ( http://mirrors.ibiblio.org/maven2):访问被拒绝到 http://mirrors.ibiblio .org/maven2/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar。错误代码 403,禁止
In Pic,
在图片中,
I have the same issue in two different machines [One of the machines with Proxy and other without proxy (Personnel laptop)]
我在两台不同的机器上遇到了同样的问题[一台带有代理的机器,另一台没有代理的机器(人事笔记本电脑)]
I'm using
我正在使用
- Eclipse Kepler
- JDK 1.6
- Maven 3.0.4
- 日食开普勒
- JDK 1.6
- Maven 3.0.4
No luck after lots of attempts; Some of them are listed below:
多次尝试后没有运气;其中一些如下所列:
- downgraded JDK [Java]from
1.7
to1.6
added proxy on
settings.xml
under [C:\Users\prashanth_sams\.m2
]added mirror in
settings.xml
underC:\Program Files\Maven\apache-maven-3.0.4\conf\settings.xml
- 将JDK [Java]从降级
1.7
为1.6
settings.xml
在 [C:\Users\prashanth_sams\.m2
]下添加代理在
settings.xml
下面添加了镜子C:\Program Files\Maven\apache-maven-3.0.4\conf\settings.xml
- located specific Maven version location externally
- 在外部定位特定的 Maven 版本位置
But, instead of jar files, I see the following two files present inside the repo with suffix, .lastUpdated
但是,而不是 jar 文件,我看到 repo 中存在以下两个带有后缀的文件, .lastUpdated
Is there any other mirrors to be added in the settings.xml? Any help is highly welcome!
在settings.xml中是否还有其他镜像要添加?非常欢迎任何帮助!
采纳答案by Prashanth Sams
This issue got fixed when I add the mirrors on settings.xmlwhich is located in C:\Program Files\Maven\apache-maven-3.0.4\conf\settings.xml
from the below URL
当我在位于以下 URL 的settings.xml上添加镜像时,此问题得到解决C:\Program Files\Maven\apache-maven-3.0.4\conf\settings.xml
After updating the XML, try Maven > Update Project..
更新 XML 后,尝试 Maven > Update Project..