Eclipse 中的 Pom.xml 错误

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/25279190/
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-09-19 21:52:52  来源:igfitidea点击:

Pom.xml error in Eclipse

javaeclipseapachemaven

提问by Sathesh Balakrishnan Manohar

I have created a web project , and when i right click the project->configure->mavenproject, I get this error in pom.xml.

我创建了一个 web 项目,当我右键单击该project->configure->maven项目时,我在pom.xml.

Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from http://repo.maven.apache.org/maven2was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org

http://repo.maven.apache.org/maven2传输 org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 失败 被缓存在本地存储库中,直到中央的更新间隔已过或强制更新。原始错误:无法传输工件 org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from/to central ( http://repo.maven.apache.org/maven2):repo.maven。阿帕奇网站

回答by Sakib Hasan

1 Goto the directory {Home}/.m2/repository/org/apache.

1 转到目录{Home}/.m2/repository/org/apache

2 Delete the maven folder. then click the project->configure->mavenproject

2 删除 Maven 文件夹。然后点击project->configure->maven项目

To be more sure:- Right click on your Maven project in Eclipse and select Maven -> Update Project...

更确定的是:- 在 Eclipse 中右键单击您的 Maven 项目并选择Maven -> Update Project...

In the appeared dialog, select the Force Update of Snapshots/Releases and click OK

在出现的对话框中,选择强制更新快照/版本并单击确定

Make sure that, you do not have any proxy related problems when updating the project again.

确保在再次更新项目时没有任何与代理相关的问题。

回答by Vic

Remove the troublesome library from your local repository manually (make it redownload). By default it's located in

手动从本地存储库中删除麻烦的库(使其重新下载)。默认情况下,它位于

%USER%.m2\repository

%USER%.m2\repository\org\apache\maven

%USER%.m2\repository

%USER%.m2\repository\org\apache\maven

Deleting the library from second location then rebuilding project usually fix the problem

从第二个位置删除库然后重建项目通常可以解决问题

回答by Muthu kumar

Failure to transfer org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 from https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.apache.maven.plugins:maven-surefire- plugin:pom:2.12.4 from/to central (https://repo.maven.apache.org/maven2): repo.maven.apache.org

https://repo.maven.apache.org/传输 org.apache.maven.plugins:maven-surefire-plugin:pom:2.12.4 失败 maven2 已缓存在本地存储库中,直到中央的更新间隔已过或强制更新。原始错误:无法传输工件 org.apache.maven.plugins:maven- surefire-plugins :pom:2.12.4 from/to central ( https://repo.maven.apache.org/maven2): repo.maven。阿帕奇网站

IN C directory you can find ur m2repository location there u need to delete surefire goto user find m2 folder ->org->apache->surefire

在 C 目录中你可以找到你的 m2repository 位置你需要删除surefire goto user find m2 folder ->org->apache->surefire

ONCE delete this sure fire folder then update ur maven project.

一次删除这个确定的火文件夹然后更新你的 maven 项目。

rightclick->maven->upddateproject(check force update) NOW Error will be gone

右键单击-> Maven->更新日期项目(检查强制更新)现在错误将消失