Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

eclipse

maven

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

<?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.

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

Thanks

like image 287
user717942 Avatar asked Oct 02 '11 09:10

user717942


3 Answers

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

<?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.core namespace.

like image 190
Luca Geretti Avatar answered Nov 14 '22 01:11

Luca Geretti


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.

like image 1
user979101 Avatar answered Nov 14 '22 01:11

user979101


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

  1. Right click on your project.
  2. Select 'Configure'.
  3. Click 'Convert to Maven Project'.
like image 1
Oly Dungey Avatar answered Nov 14 '22 02:11

Oly Dungey