Now that NetBeans
7.0 6.7 is just around the corner and comes with a set of interesting improvements, I wanted to take a few moments again reflecting what has eventually been most important to me in NetBeans IDE: Support for apache maven. Earlier I switched to NetBeans after being using Eclipse for quite a while because Maven2 tooling in Eclipse used to, well, leave a lot to be desired.
At the moment, this hasn’t really changed… right now, we’re into doing a project using a Java EE backend (created / built using NetBeans+maven) and a frontend / user interface making use of Eclipse RAP. By the way I am torn here: Despite my preferences for using and working with NetBeans, I have to say that the single-sourcing – approach of building desktop and web applications with Eclipse RCP / RAP is quite a good thing in a project like ours. At the moment I am looking into qooxdoo framework which obviously is the foundation of Eclipse RAP to see how this could eventually be used standalone along with NetBeans; so far I simply haven’t found any UI framework, even for web-only (no single-sourcing) development on NetBeans on par with RAP here. While dealing with RAP development in Eclipse, once again I had to learn that, in general, tooling there could be better, and Maven2 integration in Eclipse is still absolutely horrible. In case of that RAP application, we actually gave up on using Maven2 as a build environment as integrating Maven2, Eclipse target platforms and OSGi bundles has proven to be pretty ugly and add quite some complexity to the tooling environment even while not providing any additional benefit (thanks to the requirement to have “standard” Maven2 jar artifacts packed up in new custom artifacts to make them OSGi bundles even eliminated the possibility to use Maven2 for transitive dependency management here).
But that’s eventually a different story… So, looking at what NetBeans 6.7 has in store related to Maven2, it’s likely to excel here even more in comparison. As Maven2 support in NetBeans has been strong at the very least since early 6.x releases, it seems most of the features listed here are just “minor improvements” but, overally, these definitely add to the ease of use doing Maven2 based development using NetBeans…
Some time ago, CTRL+SPACE – based code completion has been introduced to NetBeans’
pom.xml editor which, of course, includes the different elements allowed to appear by the
pom.xml schema definition:
So far this is not too much of an “uncommon” feature and yet way more helpful than any visual editor eventually would be. Even better, however, is that by now, while editing
pom.xml, there also is code-completion support for
version content, practically allowing for browsing your repository from within the pom editor in a pretty straightforward manner:
This, eventually, so far is my most excessively used feature provided by the new Maven2 tooling…
New “Add Library” dialog
… but for all those who don’t want to use this, there also is a new way to “add libraries” to Maven2 projects from within the Project Explorer:
Basically, this also has most one could eventually wish for, including group / artifact / version code completion and a powerful search facility.
Repository Browser and Dependency Graph
More for those of us who want to “see something” on the screen: The Repository Browser window, as the name implies, allows for easily browsing different (local, remote) Maven2 repositories to get a glimpse of what’s inside. Looks good, feels good, even though I never so far used it:
Eventually more compelling is the Dependency Graph feature, which, invoked on some Maven2 project, does draw a dependency hierarchy outlining how artifacts are wired up:
This is something I do use a little more excessively in order to tell people how things in our local projects are linked; this kind of visualization at the very least is good for documentation purposes; having this image exported and somehow added to a maven2-generated project specific site would be pretty impressive…
As Maven2 in Netbeans (opposing the Eclipse approach where there is a dedicated “maven2” menu to invoke mvn-specific actions on Maven2 projects) is tightly integrated with the IDE and used as the only build mechanism in case of Maven2 projects, menu actions like “Clean” and “Build” do what they obviously should do in such a case. In situations in which “custom targets” are required, there always has been a wizard to set up such custom target actions, allowing for defining targets to be invoked as well as profiles to be used. Quite powerful, this wizard now also offers code-completion for targets and profiles available in the environment given:
This, also, is rather useful and heavily used in my environment.
In NetBeans 6.7, also the amount of Maven2 project types to be added via the “New Project…” wizard has been extended by adding new archetype templates most notably for supporting the creation of Java EE and EJB projects:
This, again, makes me want to point out that, in NetBeans, there fortunately is no need to carry around other project/build specific informations than just the
pom.xml, which, compared to Eclipse, just incredibly eases dealing with loads of Maven2 projects. Asides this, the tooling now also offers a “Build with dependencies” option allowing for, well, building a Maven2 project along with all of its required local artifacts which is rather nice a feature. Eventually, the only thing still missing about project management is the ability to simply create an “empty maven2 project” (
pom.xml pre-loaded with artifactId/groupId/version and nothing else, along with a simple, empty folder structure – src/main/, src/resources/ … in place). Maybe later. 🙂
So, to overally look at it, mkleint and the NetBeans Maven2 team has been pretty busy doing an impressive piece of work for what is likely to be NetBeans 6.7. And, looking at the fact that Maven2 projects in NetBeans still are plain, simple Maven2 projects easily to be built / used from the command line mvn as well, and looking at the fact as well that developers here try to implement features like the “build with dependencies” using Maven2 features not IDE related code makes NetBeans 6.7 so far the most reliable and most powerful frontent / tool for Maven2 development available to date. Good job, folks.