15

当我尝试清理和构建我的 Maven 项目时,我收到以下错误:

Errors occurred during the build.
Errors running builder 'Maven Project Builder' on project '(Hid Project Name)'.
org/apache/maven/project/MavenProject
Errors running builder 'Maven Project Builder' on project '(Hid Project Name)'.
org/apache/maven/project/MavenProject

与 clean all 过程类似,它会抛出以下内容:

Errors occurred during the build.
Errors running builder 'Maven Project Builder' on project '(Hid Project Name)'.
loader constraint violation: loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously initiated loading for a different type with name "org/apache/maven/plugin/MojoExecution"
Errors running builder 'Maven Project Builder' on project '(Hid Project Name)'.
org/apache/maven/plugin/MojoExecution
Errors running builder 'Maven Project Builder' on project '(Hid Project Name)'.
org/apache/maven/plugin/MojoExecution
Errors running builder 'Maven Project Builder' on project '(Hid Project Name)'.
org/apache/maven/plugin/MojoExecution
Errors running builder 'Maven Project Builder' on project '(Hid Project Name)'.
org/apache/maven/plugin/MojoExecution
Errors running builder 'Maven Project Builder' on project '(Hid Project Name)'.
org/apache/maven/plugin/MojoExecution
Errors running builder 'Maven Project Builder' on project '(Hid Project Name)'.
org/apache/maven/plugin/MojoExecution
Errors running builder 'Maven Project Builder' on project '(Hid Project Name)'.
org/apache/maven/plugin/MojoExecution
Errors running builder 'Maven Project Builder' on project '(Hid Project Name)'.
org/apache/maven/plugin/MojoExecution
Errors running builder 'Maven Project Builder' on project '(Hid Project Name)'.
org/apache/maven/plugin/MojoExecution
Errors running builder 'Maven Project Builder' on project '(Hid Project Name)'.
org/apache/maven/plugin/MojoExecution

任何想法是什么原因造成的?

4

3 回答 3

12

如果您使用的是外部 maven,请检查是否已选中 在此处输入图像描述

也尝试删除 .m2 并检查那里的设置文件是否指向 localRepository 标记中的正确位置

C:\Users\sunny.m2\repository

于 2015-04-23T07:28:04.370 回答
0

我通过更正 JDK 的 eclipse (eclipse.ini) vm 值来修复我的问题。

于 2020-03-02T19:24:44.220 回答
0

除了 Maven 安装点,还要检查 Maven 的“用户设置”。我的指向一个默认位置,但我在某个地方也有导致问题的 settings.xml。

于 2020-01-17T16:57:05.490 回答