How to skip test api docs in maven-javadoc-plugin?
Asked Answered
P

1

9

I would like to skip generating 'testapidocs' folder in my 'target/site' folder after executing 'clean skip:skip' with following configuration.

Build Configuration:

<build>
<plugins>
    .................
       <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-site-plugin</artifactId>
            <version>3.2</version>
        </plugin>

    </plugins>
   .........
</build>

Reporting Configuration:

   <reporting>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.9</version>
        </plugin>
    </plugins>
</reporting>

When i ran 'clean site:site' it is creating the following folders under 'target' directory:

target/site/apidoc

target/site/testapidocs - would like to skip this one

Peppermint answered 26/3, 2013 at 14:9 Comment(0)
S
8

The Selective Javadocs Reports told us as

To run the Javadocs reports selectively, you need to include only the Javadocs reports that you prefer. As said in the FAQ, the configuration depends on the <build/> tag or <reporting/> tag used.

Using <build/> Tag

<project>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9</version>
        <configuration>
          <!-- Default configuration for all reports -->
          ...
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>javadoc</goal>
              <goal>test-javadoc</goal>
            </goals>
            <phase>site</phase>
            <configuration>
              <!-- Specific configuration for the given reports -->
              ...
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>

Using <reporting/> Tag

<project>
  ...
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9</version>
        <configuration>
          <!-- Default configuration for all reports -->
          ...
        </configuration>
        <reportSets>
          <reportSet>
            <id>default</id>
            <configuration>
              <!-- Specific configuration for the given reports -->
              ...
            </configuration>
            <reports>
              <report>javadoc</report>
              <report>test-javadoc</report>
            </reports>
          </reportSet>
          <reportSet>
            <id>aggregate</id>
            <configuration>
              <!-- Specific configuration for the given reports -->
              ...
            </configuration>
            <reports>
              <report>aggregate</report>
            </reports>
          </reportSet>
        </reportSets>
      </plugin>
    </plugins>
  </reporting>
  ...
</project>

I hope this may help.

Slope answered 27/3, 2013 at 1:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.