12.07.2015 Views

Download - NetBeans

Download - NetBeans

Download - NetBeans

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>NetBeans</strong> Platform Development with Maven 2EThe NBM descriptor is capable of holdinga lot more data. Please see the NBM Plugindocumentation for the full schema.A5AFigure 5.NBM artifact intarget folderNext we have to edit the manifest fileand declare the layer in the OpenIDE-Module-Layer section. While the NBMPlugin lets you declare some modulemetadata, it currently supports only themanifest file but not the layer. Thus, thesrc/main/nbm/MANIFEST.MF file definedin module.xml should be created with thisline content (in a single line):OpenIDE-Module-Layer:ro/emilianbold/nbmagazine/tutorial/layer.xmlWe know that anything that isn’t a Javasource class must be placed in the resourcesfolder; the layer file is no exceptionas it will also be part of the final buildartifact. Now it’s time to rebuild and re-runthe project. You’ll be happy to notice thatthe layer is properly registered, that ourAction is working, and also that we candeclare services in META-INF/services.With the configuration done so far, themanifest, layer and NBM descriptor files,plus some dependencies, we have coveredabout 90% of the Platform developmentcases. Next we’ll talk about Java-Help modules, branding and suites, whichshould bring us to 100%.Help modulesThe <strong>NetBeans</strong> Platformhas excellent Java-Help support viaNetBean’s standardbuild harness; theNBM Plugin alsosupportsbuildingBListing 6. helpset.xmlmodules with JavaHelp documentation.First, you’ll need a new empty Maven project configured like theprevious one (but without the Action), containing a NBM descriptorand an empty layer file. I’ll assume “ro.emilianbold.nbmagazine.tutorial” as groupId and “help” as artifactId. Also, the layer mustdeclare the reference to the JavaHelp docs (see Listing 5).The helpset.xml file (see Listing 6) just contains a reference tothe location of the helpset configuration. The reason for doingthis is that the documentation won’t actually be in the main JARartifact but in a separate JAR (the kind of JAR you see in the docsfolder in the cluster).Now we get to the actual JavaHelp files. First we need to create anew folder: src/main/javahelp/${groupId}/${artifactId}/docs (withour groupId/artifactId, that would be src/main/javahelp/ro/emil-BListing 5. layer.xmlmevenide.codehaus.org/m2-site/index.htmlMevenide<strong>NetBeans</strong>integrationmodulesIssue 4 N 43

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!