15 Mar 2012

The definitive guide to Maven projects with Eclipse IDE

Written by ilgrosso

It's happened again: once in a while I must install the latest version of Eclipse IDE on my laptop, for various reasons (check some plugin, see how things look there, and so on).

Hence, one more time, I come to Eclipse website, spend some nice time finding the right version for me, then download, uncompress, start. When it prompts for workspace location, an ancient image comes in front of my eyes and I start remembering Amiga workbench and its drawers...

Suddenly, I come back from my daydream and remember that I need to deal with a Maven project, either on Subversion or Git: now first little issues arise since our friend Eclipse is stuck with Ant and CVS... what? still?

Then I googled a bit, found that there is a solar place called "the Eclipse Marketplace", search for subversion and find:

  1. Subclipse
  2. Subversive
  3. A third one whose website is not reacheable

Which one to choose? Well, the second one seems vaguely not much reliable for its name, so I decide for the first one. Download, install, restart.

Oooh, now it's Maven time: since I am not sure, I'll ask my good friend Google again "maven eclipse" and I found some very interesting links:

After spending a while reading such pages I decide to go with m2e, again from Eclipse Marketplace. Download, install, restart.

Now I should be able to access to my Maven project sources stored somewhere in my home directory: start looking into menus but I cannot find anything similar to "File -> Open Project". Google again and now I know that it's "File -> Import Project", then choose Maven as type, existing sources, map Maven plugins to Eclipse plugins. But I am not able to find mapping for all defined plugins: choose to solve these things later and finally come to see my project on the left side of Eclipse window. Hurray!

But... there are still many compilations erros: why? My project runs fine with Maven, I swear!!! :-(

Have you started asking yourself: "where is this definitive guide"? Well, it's very simple: just follow carefully the following steps:

  1. Quit Eclipse
  2. Go to Netbeans website and download latest version
  3. Install
  4. Start Netbeans
  5. "File -> Open" your existing Maven sources
  6. Start working: everything is set up

« Return