Monday, February 11, 2013

JavaFX: Using the JavaFX Doclet with Maven

The Oracle JDK ships with a JavaFX Doclet for the Javadoc tool. This doclet provides special support for JavaFX properties.

To use the JavaFX doclet you can add the following snippet to the pluginManagement section of your parent POM of your JavaFX project:


The JavaFX Doclet tutorial provides addtional information about the doclet.

Note that at the time of writing the tutorial mentions the outdated package name com.javafx.lib.doclets.formats.html.HtmlDoclet.
I already sent a feedback and asked Oracle to update the tutorial.

As the tutorial mentions, you can add the Javadoc to the private properties fields and it will generate the Javadoc for the property-method as well as for the getter and setter methods. To make this work you have to use <show>private</show> in the configuration as I've shown in the Maven snippet.

Alternatively it also seems to work when you add the Javadoc to the property-method (the Javadoc for the getter and setter method will be generated as well).

As this doclet doesn't seem to generate any Javadoc for any private-members (such as non-property-fields and -methods) even with <show>private</show>, the two options seem to be equivalent