5

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

ktm5124
  • 10,750
  • 18
  • 65
  • 104
  • 1
    This generally happens when you don't have the appropriate `` configuration section in the javadoc plugin configuration. – fge Jan 12 '13 at 23:31

1 Answers1

8

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.

Alex
  • 23,319
  • 6
  • 53
  • 50