eclipse 期间发生内部错误:“更新 Maven 依赖项”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14491298/
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
An internal error occurred during: "Updating Maven Dependencies"
提问by J4Numbers
Whenever I run eclipse, I get the message:
每当我运行 eclipse 时,我都会收到以下消息:
An internal error occurred during: "Updating Maven Dependencies".
Lorg/codehaus/plexus/archiver/jar/JarArchiver;
I am running maven version 3.0.4, and I've tried to update the JarArchiver only for it to fail time and time again.
我正在运行 Maven 版本 3.0.4,并且我尝试更新 JarArchiver 只是因为它一次又一次地失败。
Does anyone have any ideas on what might be causing the problem? If you have a solution, that would also be incredibly helpful.
有没有人对可能导致问题的原因有任何想法?如果您有解决方案,那也将非常有帮助。
回答by user2125483
After closing Eclipse I removed all versions from ~/.m2/repository/org/codehaus/plexus/plexus-archiver
except for the latest.
关闭 Eclipse 后,我删除了~/.m2/repository/org/codehaus/plexus/plexus-archiver
除最新版本之外的所有版本。
During the subsequent Eclipse startup another artifact causing an error was Maven Archiver, so I deleted old versions from ~/.m2/repository/org/apache/maven/maven-archiver
as well.
在随后的 Eclipse 启动期间,另一个导致错误的工件是 Maven Archiver,因此我也删除了旧版本~/.m2/repository/org/apache/maven/maven-archiver
。
After another Eclipse restart I performed Maven -> Update Project. All was well after that.
在另一个 Eclipse 重新启动后,我执行了 Maven -> 更新项目。之后一切都很好。
回答by user2608007
Steps below worked for me to resovle the issue(Add the following in pom.xml)
以下步骤对我有用以解决问题(在 pom.xml 中添加以下内容)
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
</plugin>
Reimport the project again in Eclipse/STS.
在 Eclipse/STS 中再次重新导入项目。
The plugin configuration is taken from the maven site below: http://maven.apache.org/plugins/maven-jar-plugin/plugin-info.html
插件配置取自下面的 maven 站点:http: //maven.apache.org/plugins/maven-jar-plugin/plugin-info.html
回答by amoe
The answer from user2125483 did not work for me. I tried selectively removing org.maven
and org.codehaus.plexus
package subdirectories of my local Maven repository (~/.m2
) without any change in the error message. I needed to nuke my entire local Maven repository and rebuild from nothing for this error to vanish.
user2125483 的回答对我不起作用。我尝试有选择地删除org.maven
和org.codehaus.plexus
打包本地 Maven 存储库 ( ~/.m2
) 的子目录,而错误消息没有任何更改。我需要取消整个本地 Maven 存储库并从无到有重建以消除此错误。
回答by vkj
Deleting the repository in the ./m2 worked for me
删除 ./m2 中的存储库对我有用
回答by Naren Baskara Rao
I tried all the above solutions but the error didn't go away. So then I checked Installed Programs on my windows machine and found two different versions of Java installed. (9.0.4 and 10.0.0) I removed Java 10 and now Maven update works. Hope this helps.
我尝试了上述所有解决方案,但错误并没有消失。然后我检查了我的 Windows 机器上的已安装程序,发现安装了两个不同版本的 Java。(9.0.4 和 10.0.0)我删除了 Java 10,现在 Maven 更新有效。希望这可以帮助。
回答by Naresh
Navigate to C:\Users\.m2\repository\org\codehaus\plexus and delete all the subfolders inside plexus and re-run the pom.xml file
导航到 C:\Users\.m2\repository\org\codehaus\plexus 并删除 plexus 中的所有子文件夹并重新运行 pom.xml 文件
!! it worked !!
!! 有效 !!