adam bien's blog

Netbeans - Stairway To Maven 📎

"...Maven2 support in Eclipse sucks. Period." as Kristian wrote this comment to one of my posts I wondered about this strong opinion. I actually used Eclipse with Maven plugin and it worked well. With the eclipse:eclipse plugin, maven creates the whole Eclipse project for you (including all the dependencies and classpath entries) - and you can just start the development. It worked so well, that I actually used it to develop some of my leisure projects (before Netbeans 5.5) too. I begun to understand Kristians clear statement :-), as I opened accidentally some of the old eclipse projects with Netbeans 6.0. It just worked, the menu structured looked very similar, I only recognized a small m2 icon in the project explorer. I began to wonder - there was no netbeans:netbeans execution or something similar - it just worked. I looked deeper into the integration and it turned out, that Netbeans support for maven is native. Netbeans just uses Maven to build the artifact instead of the internal build system. This makes a huge difference between Netbeans and Eclipse (I believe IntelliJ as well). The Netbeans-Maven integration is DRYier (Don't Repeat Yourself - no redundancies) - you have only to maintain the Maven-dependencies and you do not have to repeat it again in the IDE. This makes the work with Maven really enjoyable.

I used Maven with Netbeans in my previous projects as well - however I thought someone generated the Netbeans project already for me. However for the Maven integration you have to extend Netbeans 6.0 with a plugin (this is no more required in recent NetBeans versions). The installation is really easy - only a plugin has to be installed (it takes few minutes). Netbeans 6.0 even provides a visualization of the maven dependencies - however this feature seems not to work with Netbeans 6.1rc1.

If you have already a maven project somewhere, just try to open it with netbeans - and drop a comment here. My opinion isn't so strong as Kristian's, however I like hat Maven's integration in Netbeans work... Whats nice as well is the maven repository explorer and dependency management. However this feature is available in eclipse too.