7

在使用以下配置执行 'clean skip:skip' 后,我想跳过在我的 'target/site' 文件夹中生成 'testapidocs' 文件夹。

构建配置:

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

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

报告配置:

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

当我运行“干净的站点:站点”时,它会在“目标”目录下创建以下文件夹:

目标/站点/apidoc

target/site/testapidocs - 想跳过这个

4

1 回答 1

7

选择性 Javadocs 报告告诉我们

要有选择地运行 Javadocs 报告,您只需要包含您喜欢的 Javadocs 报告。如常见问题解答中所述,配置取决于使用的<build/>标签或<reporting/>标签。

使用<build/>标签

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

使用<reporting/>标签

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

我希望这可能会有所帮助。

于 2013-03-27T01:41:19.263 回答