JavaDoc giving fully-qualified class name... how to abbreviate?
Asked Answered
W

1

6

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 :-)

Winna answered 12/1, 2013 at 23:7 Comment(1)
This generally happens when you don't have the appropriate <links> configuration section in the javadoc plugin configuration.Fisc
T
9

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.

Tetryl answered 12/1, 2013 at 23:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.