使用Maven进行构建时,增加报告的Javadoc错误和警告的数量

时间:2018-07-29 17:04:40

标签: java maven javadoc maven-javadoc-plugin

我正在使用Maven构建一个项目,该项目的Javadoc注释有些欠佳。

我注意到,无论我修复了多少警告,我始终只收到100条警告:

Building index for all the packages and classes...
Generating ...\target\site\apidocs\overview-tree.html...
Generating ...\target\site\apidocs\index-all.html...
Generating ...\target\site\apidocs\deprecated-list.html...
Building index for all classes...
Generating ...\target\site\apidocs\allclasses-frame.html...
Generating ...\target\site\apidocs\allclasses-frame.html...
Generating ...\target\site\apidocs\allclasses-noframe.html...
Generating ...\target\site\apidocs\allclasses-noframe.html...
Generating ...\target\site\apidocs\index.html...
Generating ...\target\site\apidocs\overview-summary.html...
Generating ...\target\site\apidocs\help-doc.html...
100 errors
100 warnings
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------

我想查看所有错误和警告,或者至少查看总数。

如何使用Maven实现这一目标?

1 个答案:

答案 0 :(得分:1)

我终于找到了以下配置可以工作:

  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-javadoc-plugin</artifactId>
    <configuration>
      <additionalJOptions>
        <additionalJOption>-Xmaxerrs</additionalJOption>
        <additionalJOption>65536</additionalJOption>
        <additionalJOption>-Xmaxwarns</additionalJOption>
        <additionalJOption>65536</additionalJOption>
      </additionalJOptions>
    </configuration>
  </plugin>

它基本上将-Xmaxerrs 65536-Xmaxwarns 65536(如here所述)传递到javadoc