Maven and Eclipse, Top Eclipse Indigo Feature #10

Maven and Eclipse, Top Eclipse Indigo Feature #10

June is my favorite time of year.  Not only is summer starting (in the northern hemisphere), but it’s Christmas time for software developers.  On June 22nd, the annual Eclipse release train will arrive.  And, for the 9th year in a row, the train will arrive on-time and on-budget. While the official release — name Indigo — is not due to arrive for another 10 (business) days, I’m going to use this opportunity to highlight my 10 favorite features of this release.  This is becoming somewhat of an annual tradition for me.

The Indigo release contains 62 projects and 46 million line of code.  While I do consider myself a jack-of-all-trades when it comes to Eclipse, I unfortunately only use a subset of the projects for my daily work. If I don’t mention your favorite projects (or feature) in this article, please don’t take offence. In fact, why not write your own article?

Number 10 on my top 10 list is Maven integration with Eclipse.

Developers continually complain about the challenges surrounding release engineering.  Custom scripts to ensure test cases run properly.  Ant tasks to manipulate file sets and create deployable archives.  Source control system to manage binary dependencies.  In fact, developers will hack their builds until they work, and never touch them again — with the fear of breaking something.

The goal of the Apache Maven Project is to manage a software project’s build, reporting and documentation from a central piece of information.  While Maven has been helping Apache projects for years, for a variety of (technical) reasons, it has gained little traction with Eclipse projects… until now!

The Tycho project is a plugin designed for building OSGi bundles.  While Tycho itself is not part of Indigo, it is being used to build projects like JGit and EGit.  As well, the m2eclipse project — which brings first class maven integration to the Eclipse IDE —  is now an official Eclipse project and available with many of the Eclipse downloads.

M2Eclipse provides POM file editors, tools for materializing maven based projects, and facilities to spin Maven builds from within your IDE.  If Maven is your build technology of choice, m2eclipse is for you.

Kudos for the Tycho project go to Igor Fedorenko, Jan Sievers and Tobias Oberlies. For the m2eclipse project, shout-outs go to Benjamin Bentmann, Igor Fedorenko, Jason Van Zyl, Milos Kleint, Matthew Piggott, Pascal Rapicault, Paul Tatavu, Dmitry Platonoff and Richard Gould. Thanks everyone!

  • Scott C.
    Posted at 12:09 am, July 30, 2011

    The maven support was in many ways much better in Helios with version 0.12.

    * There was a website with actual information about installation and configuration (as usual, projects migrating to eclipse from elsewhere end up with a much harder to navigate website, with much less information)
    * It throws errors in eclipse for many common things that ‘just worked’ before. If you write a custom plugin, it begs you to install some sort of adapter for it. I wrote a custom Maven plugin that does what it needs to do in Maven, why do I need ANOTHER custom plugin for eclipse to use the plugin now (The plugin generates some Java from another resource in generate-resources, and attaches the new file(s) to the maven source folder).
    * Many common plugins cause project errors.
    * the m2e-wtp plugin required for using m2e with WTP projects is nowhere to be found in any official capacity — not even a mention on the website (which isn’t surprising, since the website/wiki is completely lacking).
    In short, about 75% of open source projects that have maven builds don’t work with m2e and most large private projects fail too.

    I can’t upgrade from Helios due to this ‘upgrade’, which is frustrating.

  • Quintin Kerby
    Posted at 5:04 pm, August 3, 2011

    I concur with Scott C. specifically about m2e-wtp integration. I spent about 4 hours wrestling with Maven and WTP before finally giving up and doing an external WAR deployment to Tomcat. I have considered moving back to Helios, but we’ll see how long I last with the extra deployment steps. Something that used to work pretty well now does not work at all. Specifically, dependency changes in the pom are not realized and deployed to the server. A full mvn install works fine in build the WAR, but the changes never show up in my server instance.

  • Per
    Posted at 3:42 pm, August 12, 2011

    I agree that the maven integration within Eclipse has gotten worse in Indigo and has made me move back to helios!

  • Peter
    Posted at 10:43 am, September 13, 2011

    I would like to agree with the comments regarding M2Eclipse integration with Maven plugins. I am not sure what the reasons are for requiring “m2e connectors” to work with plugins but the whole point, surely, is that M2E allows you to work with your Maven build “as is” .. it should not require extra work on top of setting up your POM correctly for Maven.

    Plugin developers won’t write these connectors. Why should they? They already wrote a plugin that works with Maven.

    Developers won’t write these connectors? Why should they? They already have a build that works with Maven.

    I have been an Eclipse user for a long time – since it’s inception in fact – but as I rely on Maven more and more I find Eclipse just isn’t doing the job.

    I do appreciate the effort that people put in to doing this work and I’m not trying to insult their efforts but I think this will turn a lot of people away from using Eclipse with Maven-based projects.

  • sj
    Posted at 9:40 pm, October 3, 2011

    Me too..

    I was wondering why the project was not working.. I forgot that I had upgraded eclipse..

    Maven project will modules does not work in indigo.

  • Badr
    Posted at 12:36 am, October 18, 2011

    have any one successed the m2e-wtp integration in indigo for web project ??!!! this is very painful

  • Keith
    Posted at 10:51 pm, October 18, 2011

    Have you tried installing wtp from here?

  • Jignesh
    Posted at 7:24 pm, October 19, 2011

    Keith’s link works. I am able to integrate m2eclipse plugin in seconds by following the link.
    However I have not tested it.

  • Ed
    Posted at 3:55 pm, October 21, 2011

    About m2e connectors – what they said. Or, yet another WTF#$!#&^$. IMHO, some key members of the Maven core development community suffer from a bit of a big head – “we know best – trust us, you need this”.