Friday February 15, 2008
Maven is Magic in NetBeans IDE 6.0
I came across Mark Ashworth's Connext-Graphs project a few days ago and then found that the project sources, including samples, are provided as Maven projects. Mark told me that I would first need to do a "mvn install" on the main project, after which I would be able to build the other project, i.e., the one that provides samples. So, being ignorant of Maven and all it entails, I thought: "Hmmm. I guess I'll go to the Synaptic Package Manager and see if I can find Maven there." I also googled around a bit.
Of course, I was aware of the fact that there's a NetBeans plugin for Maven. However, I assumed I'd need to install some command line tool first, which would then need to be registered in the IDE, after I'd installed the Maven plugin. At some point, I thought: "Maybe I'll install the Maven plugin first. Then I'll look for the place where I need to register the command line tool and go from there." So I went to the IDE's Plugin Manager, searched for Maven, and then had it installed 3 seconds later.
Next, I went to the New Project wizard. I thought: "Maybe I'll be able to import the Maven projects that I've downloaded from Mark's site. Once I've imported them, maybe I'll be able to build." Sure enough, I found a project type for importing Maven projects:
I clicked Next. Guess what I found? A message telling me: "Hey buddy, you don't need to import at all. Just open the project, NetBeans is smarter than you think!" Or, words to that effect:
So, I could simply open both projects, without doing anything special at all. I chose File | Open Project and then browsed to where I'd downloaded the projects from the dev.java.net site. I found that the IDE recognized the projects, because the typical NetBeans project icon showed for both of them and I thus was able to open them. Once opened in the IDE, they look like this:
And... there are contextual menu items for tasks such as building the projects:
In the end, I didn't need to do anything at all. I simply opened the projects, built them, and then ran the samples. It was an utterly boring experience, I had no issues to file in Issuezilla and I had no problems to solve at all, in any shape or form. Life sucks sometimes.
Feb 15 2008, 08:13:46 AM PST Permalink
Hey Geertjan last January I joined to MevenIDE Project I working with Milos on MevenIDE 3.1 version there are more Magic on the way :)
Posted by Anuradha G on February 15, 2008 at 12:42 PM PST #
We use Maven and the Maven plug-in for NetBeans at Project Grizzly (http://grizzly.dev.java.net). It works really well!
Posted by huntch on February 15, 2008 at 05:08 PM PST #
The Maven support is really nice. Much better than in Eclipse. I would like a more modern Maven version bundled. Or a simple way to upgrade it. You can use an external Maven installation, but then you lose some features. A lot of projects require 2.0.6 or newer.
The support for building apps on NetBeans platform with Maven could be better, but Milos is doing a great job there.
Posted by Markus Härnvi on February 16, 2008 at 02:25 AM PST #
I use the maven plugin as well, it is very nice except for one issue...
The netbeans profiler is does not work with maven projects...You can still connect to a running java app, but the usual project integration is gone.
I hope this gets fixed soon
Posted by henrik on February 16, 2008 at 05:31 AM PST #
Thanks all for the comments/feedback. I'm looking forward to profiling support for Maven projects too, Henrik.
Posted by Geertjan on February 19, 2008 at 12:43 PM PST #


