M2Eclipse Plugin is not for me

In my previous rant, I bitched about the eclipse:eclipse plugin. I got a fair amount of feedback suggesting I look at the M2Eclipse IDE plugin instead. This plugs directly into Eclipse, introducing in-IDE maven support.

Well, I’ve looked at the M2Eclipse plugin, and decided it’s still not suitable for my personal working style.

For anyone interested, here’s a short list of reasons. Note that I haven’t actually _tried_ the plugin – I’m just going off their FAQ.

  • No real support for separate output folder. I can’t stand having my IDE and my build tools compile to the same folders. With Eclipse, in particular, it’s a different compiler! Compiling to the same folders results in contention, and I don’t do it. The M2Eclipse plugin used to support this as an option, but they took it away in version 0.94. This isn’t hard folks – let Maven compile to one place, and Eclipse compile to the other, and never-the-twain-shall-meet. Strike one.
  • It uses the Maven Embedder. The Maven Embedder is not Maven. It’s a somewhat bastardised version of an unreleased-even-as-beta version of Maven. It doesn’t even use the Maven Embedder that came with 2.1 – instead, it uses a “Embedder component build in May 2008 ” which is “somewhat outdated”. This means it’s got different bugs in it from the command-line Maven. I don’t need to chase down two sources of maven bugs. Strike two. (Okay, you can apparently tell it to use an installed Maven elsewhere – wonder what functionality _that_ breaks; we currently use Maven 2.0.9 because both Maven 2.1 and Maven 2.0.10 broke stuff)
  • It wants to use the JDK associated with the JRE that launched Eclipse. Well, I use a Mac. Due to SWT issues, Eclipse on the Mac has to run under Java 1.5 (though that may change with the upcoming release). But I compile against Java 6, and that what I want to run Maven under. Strike three, and you’re out.

Look, it may be a great plugin. Obviously people like it. But it doesn’t suit me.

Advertisements

Author: Robert Watkins

My name is Robert Watkins. I am a software developer and have been for over 18 years now. I currently work for people, but my opinions here are in no way endorsed by them (which is cool; their opinions aren’t endorsed by me either). My main professional interests are in Java development, using Agile methods, with a historical focus on building web based applications. I’m also a Mac-fan and love my iPhone, which I’m currently learning how to code for. I live and work in Brisbane, Australia, but I grew up in the Northern Territory, and still find Brisbane too cold (after 16 years here). I’m married, with two children and one cat. My politics are socialist in tendency, my religious affiliation is atheist (aka “none of the above”), my attitude is condescending and my moral standing is lying down.

10 thoughts on “M2Eclipse Plugin is not for me”

  1. The Eclipse IAM project (formerly Q4E) seems be the new hotness for Maven Eclipse integration. I’ve never had much luck with m2eclipse, but IAM at least seems to work on smaller projects without drastically slowing down smaller projects.

    http://www.eclipse.org/iam/

    1. Maven is definitely not a “slam-dunk” decision to use, that’s for sure. It has many benefits, but also a lot of pain.

      In our situation at work, Maven has been a nett win. It’s just been (and continues to be) a very bumpy ride.

  2. I hope you take another look when M2e 0.9.9 is released. This version significantly alters how the maven and eclipse integration is performed. Instead of using the maven lifecycle inside the IDE, it instead delegates only certain pieces to maven plugins and the rest is left to eclipse. These changes should address all three of your concerns.

  3. Just some notes from my experience with the plugin to address your issues:

    1. Of course you can change the output-folder by modifying your pom.xml to have separate output-folders for your class-files.
    2. You can tell the plugin which maven installation it should use and it doesn’t break anything if you do so.
    3. If you don’t use the internamm maven builder then maven will use the JRE configured under “Installed JREs”.

    Give it a try – it takes a little time getting used to but I wouldn’t want to miss working with the plugin.

    1. @Benedict
      1. Of course you can change the output-folder by modifying your pom.xml to have separate output-folders for your class-files.
      U mean the output folder for eclipse could be configured to be different than the one in the pom.xml? How?

  4. Are you sure about “Of course you can change the output-folder by modifying your pom.xml to have separate output-folders for your class-files”.
    My experience is that a lot of Maven plugin cannot be configured to produce their output in a particular non-default location. 80 of your output will be produced in a separate folder, but 20 will still be produced in the same target folder, resulting in an even bigger nightmare.
    Or am I wrong ? I hope so.

    1. Like this:

      <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-eclipse-plugin</artifactId>
          <version>2.5.1</version>
          <configuration>
              <downloadSources>true</downloadSources><!-- Having source code references is a "Good Thing" (tm) -->
              <downloadJavadocs>true</downloadJavadocs><!-- Having source code references is a "Good Thing" (tm) -->
              <buildOutputDirectory>${eclipse.classes.dir}</buildOutputDirectory><!-- Not having to re-compile everything inside Eclipse just because you've done a Maven clean is also a "Good Thing" (tm), but not everyone likes it, so it's configurable (and off by default) -->
              <useProjectReferences>true</useProjectReferences>
          </configuration>
      </plugin>
      

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s