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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 14:48:10  来源:igfitidea点击:

Unable to download .jar files inside m2 repository using maven dependencies

javaeclipsemavenmaven-2m2eclipse

提问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,

在图片中,

enter image description here

在此处输入图片说明



I have the same issue in two different machines [One of the machines with Proxy and other without proxy (Personnel laptop)]

我在两台不同的机器上遇到了同样的问题[一台带有代理的机器,另一台没有代理的机器(人事笔记本电脑)]

I'm using

我正在使用

  1. Eclipse Kepler
  2. JDK 1.6
  3. Maven 3.0.4
  1. 日食开普勒
  2. JDK 1.6
  3. Maven 3.0.4

No luck after lots of attempts; Some of them are listed below:

多次尝试后没有运气;其中一些如下所列:

  • downgraded JDK [Java]from 1.7to 1.6
  • added proxy on settings.xmlunder [C:\Users\prashanth_sams\.m2]

    enter image description here

  • added mirror in settings.xmlunder C:\Program Files\Maven\apache-maven-3.0.4\conf\settings.xml

  • JDK [Java]从降级1.71.6
  • settings.xml在 [ C:\Users\prashanth_sams\.m2]下添加代理

    在此处输入图片说明

  • settings.xml下面添加了镜子C:\Program Files\Maven\apache-maven-3.0.4\conf\settings.xml

enter image description here

在此处输入图片说明

  • located specific Maven version location externally
  • 在外部定位特定的 Maven 版本位置

enter image description here

在此处输入图片说明

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中是否还有其他镜像要添加?非常欢迎任何帮助!

enter image description here

在此处输入图片说明

采纳答案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.xmlfrom the below URL

当我在位于以下 URL 的settings.xml上添加镜像时,此问题得到解决C:\Program Files\Maven\apache-maven-3.0.4\conf\settings.xml

http://repo1.maven.org/maven2/.meta/repository-metadata.xml

http://repo1.maven.org/maven2/.meta/repository-metadata.xml

After updating the XML, try Maven > Update Project..

更新 XML 后,尝试 Maven > Update Project..