如何在 Maven 3 站点插件中禁用测试 Javadoc 报告的生成?

yeg*_*256 5 java maven-3 maven maven-site-plugin

这是我的pom.xml,我正在尝试禁用Test Javadoc报告site

[...]
<build>
  [...]
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-site-plugin</artifactId>
    <configuration>
      <reportPlugins>
        [...]
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <configuration>
            <reportSets>
              <reportSet>
                <id>html</id>
                <reports>
                  <report>javadoc</report>
                </reports>
              </reportSet>
            <reportSet>
          </configuration>
        </plugin>
      </reportPlugins>
    </configuration>
  </plugin>
</build>
Run Code Online (Sandbox Code Playgroud)

仍然 Maven3在站点中生成JavadocTest Javadoc报告。如何解决?

Rag*_*ram 2

正如Selective Javadocs reports中记录的那样,这对我来说是正确的。您可以重新检查您正在使用的插件的版本吗?使用下面的代码片段并mvn site使用 Maven 3.0.1 运行,只会Javadoc生成。<report>test-javadoc</report>在现有标记下方添加行<report>会导致生成JavadocTest Javadoc

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.0-beta-3</version>
            <configuration>
                <reportPlugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.7</version>
                        <reportSets>
                            <reportSet>
                                <id>html</id>
                                <reports>
                                    <report>javadoc</report>
                                </reports>
                            </reportSet>
                        </reportSets>
                    </plugin>
                  </reportPlugins>
              </configuration>
          </plugin>
Run Code Online (Sandbox Code Playgroud)