Problem
I'm running mvn javadoc:javadoc
to generate JavaDoc, and I am pleased with the results, except for one thing: it gives the fully qualified class names for any class coming from a third-party library or our own codebase. For example,
It gives a return type of com.project.beans.BeanA, com.project.beans.BeanB for methods that return one of these classes.
It gives a param type of org.codehaus.jettison.json.JSONObject for a method that takes a JSON object. (Whereas it gives a param type of Integer for a method that takes a java.lang.Integer.)
Question
Is there any way to generate the shorthand names for these classes, for readability purposes? i.e. BeanA, BeanB, JSONObject.
And is there a way to do this without any XML configuration?
Thanks in advance :-)
Javadoc provides the @link inline tag for referencing the members in the Java classes. We can think of the @link tag as similar to the anchor tag in HTML, which is used to link one page to another via hyperlinks. Similar to the anchor tag, the path_to_member is the destination, and the label is the display text.
The correct approach is an @param tag with the parameter name of <T> where T is the type parameter name. There should be one blank line between the Javadoc text and the first @param or @return. This aids readability in source code. The @param and @return should be treated as phrases rather than complete sentences.
The javadoc TagsRepresents the relative path to the generated document's root directory from any generated page. Adds a comment indicating that this API should no longer be used. Adds a Throws subheading to the generated documentation, with the classname and description text.
Accessing the Javadoc from NetbeansSelect the desired package, class or method name, right-click and select Show Javadoc. This will launch your default web browser and navigate to the Javadoc for the selected item.
I believe that what you want is the -noqualifier
javadoc option which can be set directly from the maven javadoc:javadoc
command.
Usually to pass the parameter to a maven plugin you just do like for other Java programs using -D
, in this case it would be mvn -Dnoqualifier=all javadoc:javadoc
but as far as I can tell the noqualifier
does not seems to ben set as an expression in the plugin source so I don't really know if you can pass it via the command line.
If it does not work, you can either modify your pom.xml
and add the <noqualifier>all</noqualifier>
to the config of the javadoc
plugin. Or you could create a property in your pom that will be given as a value for the <noqualifier>
tag, but this time the property can be overridden using the command line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With