Using Maven and Mevenide to create Netbeans modules
This is a step by step guide on developing Netbeans modules (plugins) using Maven and Mevenide. It doesn't matter if the module is for Netbeans IDE or your custom application based on Netbeans Platform.
The tutorial assumes basic knowledge module development as described on netbeans.org site (Api List page and openide site in general). In this text below we discuss the specific issues of building Netbeans modules using Maven, not how to use the APIs to create a module.
Installing Maven is rather straightforward, just follow instructions.
It's important that you setup the MAVEN_HOME environment property (Windows installer does it for you).
If you are behind firewall, you should setup Maven to use your proxy settings. It's best done by creating a file named build.properties in your user home directory and populate it with the required proxy related properties.
First download the latest Mevenide release.
This tutorial assumes you have installed Mevenide for Netbeans, however the same can be achieved through the Mevenide for Eclipse with minor variations, in case you want to develop Netbeans modules with that IDE.
On the command-line, run this command which downloads the appropriate maven plugin for creating Netbeans modules:
Assuming you already have the Netbeans IDE or Netbeans Platform that you want to develop against, please recall it's installation directory. If you don't have it, please install it first.
. It will prompt you for the installation directory. Then it will find all Netbeans modules that are in that directory structure and copy them to your local Maven repository. (That's where Maven is looking for artifacts/dependencies, unfortunately there's currently no remote repository that would host Netbeans artifacts).
You can later check maven-nbm-plugin homepage for updates and details on other available goal and customization properties.
Start up Netbeans IDE (assuming Mevenide 0.6 installed) and create a new project, under Maven category there is "Sample Netbeans module" project template. A skeleton project is created for you.
Now we need to specify the correct Netbeans API module jar dependencies.
If you have done everyting correctly, you should have the Netbeans APIs now available in the editor when you start coding your module.
Building is simple, just run "Build" or "Rebuild" from the project's popup menu. The resulting module jar and nbm files will appear under target/nbm directory in your project.