Via Milos Kleint's blog yesterday I learned about the brand new possibility of using annotations in NetBeans Platform applications driven by Maven. That means that the NetBeans Platform Quick Start can now work under Maven.
Here are some things to note, when converting from the above Ant-based tutorial to Maven:
  1. Declare packages as public like this, in the definition of "nbm-maven-plugin" in the pom.xml file of the module where the class is defined: org.codehaus.mojo nbm-maven-plugin 3.1 true src/main/nbm/module.xml ${brandingToken} foobar com.editor.interface
    More details on NetBeans-specific Maven tags by Fabrizio here. You can also use the asterisk, as described here to also set all subpackages as public to the whole application.
  2. Add the Plexus repository to the "repositories" element of the container's pom.xml file: plexus-snapshots Plexus Snapshots
    Then redefine the "maven-compiler-plugin" as follows, as stated in Milos' blog, again in the container's pom.xml file: org.apache.maven.plugins maven-compiler-plugin 2.1 1.6 1.6 org.codehaus.plexus plexus-compiler-javac 1.7-SNAPSHOT org.codehaus.plexus plexus-compiler-api 1.7-SNAPSHOT
And now you're done. The rest of the quick start is the same as in the Ant-based version. The META-INF/services folder will be created thanks to the @ServiceProvider annotation and you'll be able to use Lookup to get hold of the implementation automatically registered there when the application is compiled.