Geertjan's Blog

  • January 9, 2010

JavaHelp in a Mavenized NetBeans Platform Application

Geertjan Wielenga
Product Manager
I successfully created JavaHelp for my Mars Rover Viewer on Maven:

  1. In the pom.xml of the container (i.e., the highest level pom.xml file):


    A comment from Milos Kleint: "You need to make sure the project is using 3.0 nbm-plugin (as done above), the setup with 3.1 plugin is broken currently. 3.1 is using netbeans 6.7 ant tasks. Someone put some classes in the com.sun.javahelp package there in the ant tasks jar. Which seems to work with the nb.org javahelp jar, but fails with the javahelp jar in the maven repository. The maven repo jar is signed unfortunately and the few additional classes in the same package, but different jar messes up the classloading permissions and the signing fails. which is a pity as 3.1 didn't need the plugin dependency addition, so was simpler to configure.. a workaround I found was to un-sign the javahelp jar in the local maven repo, but that's nasty."

  2. In the manifest of the module where the help content is found:
    OpenIDE-Module-Requires: org.netbeans.api.javahelp.Help

  3. Create an Ant-based NetBeans module and use the JavaHelp wizard. Then copy the created "JavaHelp" module to your Maven module's "src/main/javahelp".

  4. Layer.xml entry:
    <folder name="Services">
    <folder name="JavaHelp">
    <file name="module1-helpset.xml" url="module1-helpset.xml">
    <attr name="position" intvalue="3818"/>

I needed to remove the "search" tags in the "-hs" file, otherwise a "search is invalid" error was thrown when the Help menu item was selected. That should result in other problems but at least the help content is shown and you can search it anyway.

Join the discussion

Comments ( 2 )
  • Jesse Glick Monday, January 11, 2010

    If com.sun.javahelp in nbbuild is causing problems, file a bug in nbbuild to have it be removed - there is probably some other workaround. Best would be for the original bug in JH to be fixed and then we would bundle the new release.

  • Jesse Glick Monday, January 11, 2010
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.