Skip to end of metadata
Go to start of metadata

Disclaimer: Any of these cannot be currently added/changed from the IDE's UI. These extension points are only accessible to developers willing to provide additional functionality.

Custom Maven Project templates

You can add your site specific maven project template with predefined values. It can contain the project.xml POM file, the properties files, custom maven.xml and other files and directories you want to make part of the default setup.

  • First you will need to create a new maven project for the extension you want to provide. You will need to create a dependency on the current version of mevenide-netbeans-project module. Please check the http://mevenide.codehaus.org/mevenide-netbeans-project site or the IDE's Tools/Option dialog for current version you have installed. (version 0.4 should be ok).
  • create a custom manifest file:
    where the org/myorganization/myextension string is the package declarion of your project, and the MavenLayer.xml file is included in the resources of the project and will be included in the jar.
  • assign maven.nbm.manifest property with the location of the manifest file, so that the definiton is included in the jar when building the module.
  • write the MavenLayer.xml file. Example code looks like this:
    • SystemFileSystem.localizingBundle attribute of the mytemplatename.zip file in the definition point to a Bundle.properties file that has to be included in the jar at the defined package. It shall include the localizable name for your Maven project template. The property key is the path within the layer file, eg.
    • By specifying the SystemFileSystem.icon attribute, you can provide your own icon for the template.
    • instantiatingWizardURL attribute point to a HTML file describing your template in more detail. Please stick to simple HTML.
  • The mytemplatename.zip file contains all the files and directories that you want to be included in the project. At least it should contain project.xml file. Place it in your module at the same directory/package as the MavenLayer.xml file.
  • Once you created all the files and placed them in the right positions in the artifact, it should be enough to create an NBM file for your project and install it in the IDE. The custom project template should be available to the user in the New project dialog.

Additional information about defined maven plugin's properties.

By default mevenide tries to guess the properties of a maven plugin by consulting the plugin cache and the plugin.properties file there. However not all properties have an entry in the plugin.properties file. In order to get a complete list and also to provide additional information about the properties, one can create a module that improves the behaviour for the plugin.

  • Steps are similar to the previous case. Create a netbeans module with manifest and layer file.
  • The layer file points to a xml file that describes the plugin's properties.
    where mycustom-plugin.xml file is located relatively to package of the layer file. The expected filename pattern on the system filesystem is <plugin-name>-<version>.xml. That way one can specify definitions for multiple versions of one plugin.
  • The mycustom-plugin-1.5.xml file can look like this:

Custom jelly taglibrary code completion

  • First you will need to create a new maven project for the extension you want to provide. You will need to create a dependency on the current version of mevenide-netbeans-grammar module. Please check the http://mevenide.codehaus.org/mevenide-netbeans-grammar site or the IDE's Tools/Option dialog for current version you have installed.
  • create a custom manifest file:
    where the org/myorganization/myextension string is the package declarion of your project, and the MavenLayer.xml file is included in the resources of the project and will be included in the jar.
  • assign maven.nbm.manifest property with the location of the manifest file, so that the definiton is included in the jar when building the module.
  • write the MavenLayer.xml file. Example code looks like this:
    where you replace the jelly-antlr string with the name of your taglib. Under this name it will be later known to the completion engine. You can have multiple taglib definitions into the layer, just write multiple <file> elements.
  • include also the taglib definition xml file. The syntax is quite simple and self-describing as the example shows.
    The attribute within lets you define scope of the particular tag. In this example tag and bean tags will only appear within the taglib tag.
  • Once you created all the files, it should be enough to create an NBM file for your project and install it in the IDE. The custom taglib completion info should be available to the user.
Labels: