Monday, August 17, 2009

Nice NetBeans/Maven integration

Just found this pretty cool feature in the latest 6.8 M1 release of NetBeans... when working with Maven project, you can, of course setup dependencies on other Maven libraries, but 'native' NetBeans projects don't have this ability -- you can only setup dependencies to other Projects, to 'Libraries', and to random .jar files... however, NetBeans now has the ability to create Libraries from Maven libraries, and then use those in any projects... check this out...

Open the Maven Repository Browser (Window -> Other -> Maven Repository Browser if you haven't seen this before), and find a project you're interested in by either browsing or searching... once you're here, right click on the version you want, and select 'View Details', like so:

This brings up the details of the .pom file, which has all sorts of good stuff, but the cool part is the icon of the stack of books in the upper right -- click this, and it will automatically download the project and set it up as a NetBeans Library, for use in any project... pretty sweet!

Of course, this may have been here all along -- if anyone knows of a prior version of NetBeans that this works with, chime in!



mkleint said...

it's there since 6.7

Matt Corey said...

Even better -- that means you don't need a pre-release to take advantage of it :)

Erik said...

What you can't do, at least not in 6.7 I believe, is set up a dependency on a maven *project* (i.e. the sources instead of the jar). This is necessary if you want to retain all of the cross-project refactoring capabilities. That said, my 6.7 install seems a bit buggy as far as maven goes, so ymmv.

Anna said...

Great and Useful Article.

J2EE Training

Java EE course

Java EE training

J2EE training in chennai

Java J2EE Training Institutes in Chennai

Java J2EE Training in Chennai

Java EE training

Java Interview Questions