【问题标题】:Missing builder(org.maven.ide.eclipse.maven2Builder)缺少构建器(org.maven.ide.eclipse.maven2Builder)
【发布时间】:2011-11-29 08:17:27
【问题描述】:

我正在使用 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>

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

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

谢谢

【问题讨论】:

    标签: eclipse maven


    【解决方案1】:

    很可能是声明的构建器类和您的 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>
    

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

    【讨论】:

    • 从 Eclipse Indigo 3.7.2 升级到 Juno 4.2.1 并安装最新的 m2e 后出现同样的问题,与我之前安装的旧版本的 m2e 相比。该解决方案立即奏效。
    【解决方案2】:

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

    【讨论】:

      【解决方案3】:

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

      1. 右键单击您的项目。
      2. 选择“配置”。
      3. 点击“转换为 Maven 项目”。

      【讨论】:

        猜你喜欢
        • 2022-01-22
        • 2018-02-03
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-06-11
        • 1970-01-01
        • 2021-10-29
        • 2019-08-20
        相关资源
        最近更新 更多