Migrating my Mind to Maven (Part 1) – Packaging the Application

Originally all NetBeans Platform applications were built using the Ant-based build harness. And of course this option is still available in NetBeans 7.1. However, the IDE also has tool support for creating platform applications built with Maven, which was added in more recent versions.

I have been working with the NetBeans Platform since 5.5 days, and I have learned a good deal about the Ant build harness over the years. Last week I started a new job and now I am wrapping my mind around building a platform application using Maven. This is the first of an (as yet) unknown number of articles documenting the lessons that I am learning in this process about the differences between the two approaches. It is my hope that the information will make the mind shift from Ant to Maven easier for other developers. 🙂

One of the first questions that came to mind after I created my first Maven-based platform application, is “where did the Package As… menu go?” The context menu of an Ant-based suite used to contain a lot of separate packaging actions back in the day. More recently, all these actions (including the one that builds a zip file) were moved to the Package As… menu. But for my Maven project, no such menu was anywhere to be found!

After a brief moment of frustration, I decided to have a look at the folder structure of the project once it was built. And there I found a zip distro that looks identical to the one I would have expected from an Ant-based project. As it turns out, this always gets built when you build the application, and is stored in the application/target folder.

Another useful thing in the same location is the userdir folder – this is the equivalent of the build/testuserdir folder for an Ant-based application.

Read the Maven Best Practices wiki page for some more interesting information.

Leave a Comment