How to convert an ANT-based NetBeans Module to a Maven-based NetBeans Module

I am currently converting some of my ANT-based NetBeans Modules to Maven-based ones. I didn’t found a step-by-step migration list, so I decided to create one and to share it with you. The following list was created while converting a simple plugin with less than 20 classes, so the migration steps of large projects might vary. But you should get the basic idea.

  • create a new maven based NBM using the “New Project”-wizard (to reuse a working configuration)
  • copy the folder src and pom.xml to the old project
  • in pom.xml
    • define a groupId
    • set the name from OpenIDE-Module-Name entry in
    • set the artifactid from OpenIDE-Module entry in MANIFEST.MF
    • set the version from OpenIDE-Module-Specification-Version entry in MANIFEST.MF
  • remove the line with OpenIDE-Module-Specification-Version entry from MANIFEST.MF
  • remove the line with OpenIDE-Module entry from MANIFEST.MF
  • remove nbproject/
  • remove nbproject/
  • remove nbproject/build-impl.xml
  • remove build.xml
  • move to folder src/main/nbm
  • move your sources (*.java) to src/main/java (or src/test/java) (GIT is very useful here, the commit history isn’t lost)
  • move your resources (not *.java) to src/main/resources (or src/test/resources) (especially
  • add dependencies (the most annoying part)
    • foreach dependency entry (code-name-base) in nbproject/project.xml add a dependency via the “Add dependency” dialog OR add a dependency manually to pom.xml

    For example use




    (!) Note that the dots in the dependency name have to replaced by a dashes

  • add test dependenciesFor example use



There is still more to do. Like to configure export packages, signing, homepage and so one. Most of these configuration settings defined in the original have a counterpart in the plugin configuration of the nbm-maven-plugin. See the detailed goal documentation at

But your mavenized plugin should start at least now.

PS: The whole process is worth a plugin itself.  Any volunteer?


3 thoughts on “How to convert an ANT-based NetBeans Module to a Maven-based NetBeans Module

  1. I recall having an experimental cmd line tool a while back that attempted to convert to maven. I think I got all the way to compiling platform but no further as then it required additional manual steps. Unfortunately it’s a few years back already and cannot find it in any of my public repositories, so it’s likely gone.

    probably not worth doing as a netbeans plugin, it’s not something that’s to be used daily. On the other hand maybe when using netbeans APIs you could get some stuff for free, like git/hg move. but not sure there.

  2. I have
    and I converted to
    When I compile I got:
    Private classes referenced in module: [org.netbeans.lib.editor.bookmarks.api.BookmarkList, org.netbeans.lib.editor.bookmarks.api.Bookmark]
    Project depends on packages not accessible at runtime in module org.netbeans.modules:org-netbeans-modules-editor-bookmarks:jar:RELEASE82
    Can u give me a help please?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s