缺少构建器(org.maven.ide.eclipse.maven2Builder)

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

Missing builder(org.maven.ide.eclipse.maven2Builder)

eclipsemaven

提问by user717942

I'm using Eclipse Indigo and have the following in my .project file:

我正在使用 Eclipse Indigo 并且在我的 .project 文件中有以下内容:

<?xml version="1.0" encoding="UTF-8"?> 
  <projectDescription> 
    <name>new project</name> 
    <buildSpec> 
      <buildCommand> 
        <name>org.eclipse.jdt.core.javabuilder</name> 
      </buildCommand> 
      <buildCommand> 
        <name>org.maven.ide.eclipse.maven2Builder</name> 
      </buildCommand> 
    </buildSpec>
    <natures> 
      <nature>org.eclipse.jdt.core.javanature</nature>       
      <nature>org.maven.ide.eclipse.maven2Nature</nature> 
    </natures> 
  </projectDescription>

I have the m2e - Maven Integration for Eclipse installed. But I am getting Missing builder(org.maven.ide.eclipse.maven2Builder) under the Builders properties and I am getting a java.lang.ClassNotFoundException: when I try to running a class file from my project.

我安装了 m2e - Eclipse 的 Maven 集成。但是我在 Builders 属性下遇到 Missing builder(org.maven.ide.eclipse.maven2Builder) 并且我收到 java.lang.ClassNotFoundException: 当我尝试从我的项目运行类文件时。

I guess I am missing something in the config somewhere or a plugin?

我想我在某个地方的配置或插件中遗漏了一些东西?

Thanks

谢谢

回答by Luca Geretti

It is most likely a mismatch between the declared builder class and your m2e plugin. Try this:

这很可能是声明的构建器类和您的 m2e 插件之间的不匹配。尝试这个:

<?xml version="1.0" encoding="UTF-8"?> 
<projectDescription> 
    <name>new project</name> 
    <buildSpec> 
        <buildCommand> 
            <name>org.eclipse.jdt.core.javabuilder</name> 
        </buildCommand> 
        <buildCommand> 
            <name>org.eclipse.m2e.core.maven2Builder</name> 
        </buildCommand> 
    </buildSpec> 
    <natures> 
        <nature>org.eclipse.jdt.core.javanature</nature> 
        <nature>org.eclipse.m2e.core.maven2Nature</nature> 
    </natures> 
</projectDescription>

Please note the different org.eclipse.m2e.corenamespace.

请注意不同的org.eclipse.m2e.core命名空间。

回答by user979101

While changing to the newer m2e plugin might work, it may not. You can install the older m2e plugin version which uses the old tag in Indigo. See http://m2eclipse.sonatype.org/installing-m2eclipse.html. Unfortunately, you can't have both the old and new installed at once, so if you managed to install the new one, you will have to uninstall it before installing the older version.

虽然更改为较新的 m2e 插件可能有效,但可能无效。您可以在 Indigo 中安装使用旧标签的旧版 m2e 插件。请参阅http://m2eclipse.sonatype.org/installing-m2eclipse.html。不幸的是,您不能同时安装新旧版本,因此如果您设法安装了新版本,则必须在安装旧版本之前将其卸载。

回答by Oliver Dungey

@LucaGeretti's answer was exactly my problem, fixing it in Eclipse Indigo can be done easily from the IDE:

@LucaGeretti 的回答正是我的问题,可以从 IDE 轻松地在 Eclipse Indigo 中修复它:

  1. Right click on your project.
  2. Select 'Configure'.
  3. Click 'Convert to Maven Project'.
  1. 右键单击您的项目。
  2. 选择“配置”。
  3. 单击“转换为 Maven 项目”。