How to disable generation of Test Javadoc report in Maven 3 site plugin?

浪尽此生 提交于 2019-12-07 07:05:36

问题


This is my pom.xml, I'm trying to disable Test Javadoc report in 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>

Still Maven3 generates both Javadoc and Test Javadoc reports in the site. How to fix it?


回答1:


This works correctly for me as documented in Selective Javadocs reports. Can you re-check the versions of the plugins that you are using? With the snippet below and running mvn site using Maven 3.0.1, only Javadoc gets generated. Adding the line <report>test-javadoc</report> below the existing <report> tag results in both Javadoc and Test Javadoc getting generated.

        <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>


来源:https://stackoverflow.com/questions/4544322/how-to-disable-generation-of-test-javadoc-report-in-maven-3-site-plugin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!