I recently upgraded my development environment from Java 7 to Java 8, which now finds a large number of previously-undetected javadoc issues.
By default, Ant (invoked via Eclipse Mars) limits its warnings (and I assume errors) to 100:
Is there any parameter to force Ant to display all javadoc warnings instead of limiting to 100?
I attempted to use the -Xmaxwarns 1000
parameter via the compilerarg
element, but it appears that the current Ant version in Eclipse Mars (Ant 1.9.4) javadoc task does not support the compilerarg
element (it is only supported in the javac task):
<!-- Generate the API documentation. -->
<target name="javadoc" depends="clean" description="Generate the API documentation.">
<!-- Create the build directory structure used by javadoc. -->
<mkdir dir="${build.folder}" />
<mkdir dir="${docs.folder}" />
<!-- Run javadoc. -->
<javadoc destdir="${docs.folder}/api" author="true" version="true" use="true" windowtitle="${documentation.title}">
<compilerarg value="-Xmaxerrs 1000 -Xmaxwarns 1000" />
<classpath>
...
Java 8 javadoc
does support these parameters (support was added in Java 7 b100):
C:\>javadoc -X
-Xmaxerrs <number> Set the maximum number of errors to print
-Xmaxwarns <number> Set the maximum number of warnings to print
Provided by standard doclet:
-Xdocrootparent <url> Replaces all appearances of @docRoot followed
by /.. in doc comments with <url>
-Xdoclint Enable recommended checks for problems in javadoc comments
-Xdoclint:(all|none|[-]<group>)
Enable or disable specific checks for problems in javadoc comments,
where <group> is one of accessibility, html, missing, reference, or syntax.
These options are non-standard and subject to change without notice.
Conclusion: It appears that the Ant javadoc
task is the limiting factor here, and if it supported the compilerarg
flag, it would be possible to adjust the limit on errors and warnings.
As you noted, -Xmaxwarns
affects how many warnings the javadoc
program outputs.
-Xmaxwarns
can be passed to the javadoc
program with nested <arg>
elements:
<javadoc ...>
<arg value="-Xmaxwarns"/>
<arg value="200"/>
</javadoc>
In my own test case, I was able to increase the reported warnings above 100:
[javadoc] Generating Javadoc
...
[javadoc] 112 warnings
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