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.

Comments:

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 04:42 AM 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 09:08 AM 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 15, 2008 at 06:25 PM 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 15, 2008 at 09:31 PM 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 04:43 AM PST #

Hi Geertjan:

I'm developing an application based on tapestry5
and I'm interesting in maven plugin in netbeans because Tapestry5 has the "live class reloading" feature so with it you can save the java file and then view the change witout redeploy the web application like eclipse does: http://bbwebcraft.blogspot.com/2009/01/task-3-rapid-turnaround-in-tapestry-5.html

I posted the next question in netbeans forums but I haven't an answer:
With netbeans you can "deploy on save" on web applications and "compile on save" on java applications BUT you can't "compile on save" on webapplications in order to implement live class reloading, so you know if with Netbeans7.0 and maven plugin you can do it ?

Thanks in advance.

Posted by Carlos Gómez on February 04, 2009 at 12:44 PM PST #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today