Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0
-
Fix Version/s: 2.5
-
Labels:None
-
Number of attachments :
Description
I'm working on a custom doclet that wraps the standard doclet and add extra behaviour (automated class diagram generation in class javadocs and package javadocs). I want to run it under maven 2, but I've stumbled against the default behaviour: standard doclet parameters such as -link are provided only if the javadoc is the standard one (in AbstractJavadocMojo.java, the check is "if ( StringUtils.isEmpty( doclet ) ) ...").
A generally good behaviour would be not perform assumptions, but to call XXXDoclet.optionLength for each parameter, and see if the doclet accepts them or not (and thus provide only the one accepted). As an alternative, add at least a flag to allow the provision of the standard doclet parameters to the custom ones as well.
I would add that I also think this is needed. Another reason is that you may actually specify what is the default doclet, but the mere presence of the doclet element blocks the default parameters from being used. Such a configuration was useful when recently the javadoc plugin did not use the default doclet behavior by default; and if you wanted the default output provided by your JDK then you had to explicitly specify it – and then these swithces were not passed to the doclet. Note that I actually don't know what Maven is now using as the default doclet since I haven't actually checked into it, but it now at least appears to be the default one – there is a new color scheme since 5.0 that now is being used in Maven's output.
The suggestion noted above sounds great. Frankly though, simply always passing whatever has been declared sounds fine to me, even if an exception results, since this should be expected by anyone declaring these attributes alongside one another. Exceptions are always acceptable.