gpt4 book ai didi

maven-3 - 如何在 maven-javadoc-plugin 中跳过测试 api 文档?

转载 作者:行者123 更新时间:2023-12-02 17:02:12 25 4
gpt4 key购买 nike

使用以下配置执行“cleanskip: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>

当我运行“clean site:site”时,它会在“target”目录下创建以下文件夹:

目标/站点/apidoc

target/site/testapidocs - 想跳过这个

最佳答案

Selective Javadocs Reports告诉我们为

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.

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

希望这会有所帮助。

关于maven-3 - 如何在 maven-javadoc-plugin 中跳过测试 api 文档?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15639185/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com