Eclipse Juno 使用“Maven Project Builder”构建错误

Posted

技术标签:

【中文标题】Eclipse Juno 使用“Maven Project Builder”构建错误【英文标题】:Eclipse Juno build error with "Maven Project Builder" 【发布时间】:2013-01-19 11:03:44 【问题描述】:

当我尝试清理和构建我的 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

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

【问题讨论】:

你能从命令行运行 mvn compile 吗? 在这里你可以找到你的答案***.com/questions/12533885/… 【参考方案1】:

如果您使用的是外部 maven,请检查是否已选中

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

C:\Users\sunny.m2\repository

【讨论】:

投票赞成成为 3 年内唯一回复此问题的人!我认为这值得一个徽章。【参考方案2】:

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

【讨论】:

【参考方案3】:

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

【讨论】:

以上是关于Eclipse Juno 使用“Maven Project Builder”构建错误的主要内容,如果未能解决你的问题,请参考以下文章

Eclipse Juno 4.2 的 Swing 插件 [重复]

IBM Worklight - Win7/Eclipse“Juno”中的插件安装失败

Eclipse Juno 在 Windows 8 下找不到存储库

Eclipse Juno 使用“Maven Project Builder”构建错误

为啥我不能在 Eclipse Juno 中保存文件?

使用 PyDev 和 Virtualenv 设置 Eclipse Juno