我最近将我的开发环境从 Java 7 升级到了 Java 8,现在发现了大量以前未检测到的javadoc问题。
默认情况下,Ant(通过 Eclipse Mars 调用)将其警告(我假设错误)限制为 100:
是否有任何参数可以强制 Ant 显示所有 javadoc警告而不是限制为 100?
我尝试-Xmaxwarns 1000
通过元素使用参数compilerarg
,但似乎 Eclipse Mars (Ant 1.9.4) javadoc 任务中的当前 Ant 版本不支持该compilerarg
元素(仅在javac 任务中支持):
<!-- 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 8javadoc
确实支持这些参数(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.
结论:似乎 Antjavadoc
任务是这里的限制因素,如果它支持该compilerarg
标志,则可以调整错误和警告的限制。