从 1.1 版开始,所有 Maven 报告将默认包含在生成的 PDF 中。您应该配置类似于 站点插件的 POM 的 <reporting/> 部分
例如,您可以拥有以下内容:
<project> ... <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-project-info-reports-plugin</artifactId> <version>2.1.2</version> <reportSets> <reportSet> <reports> <report>project-team</report> ... </reports> </reportSet> </reportSets> </plugin> ... </plugins> </reporting> ... <project>
拥有许多报告会大大增加构建时间,因此建议仅选择要包含在 PDF 中的所需报告。建议在您的 pom 中定义报告配置文件,类似于以下内容:
<project> ... <profiles> <profile> <id>pdf</id> <reporting> <plugins> <plugin> <artifactId>maven-project-info-reports-plugin</artifactId> <version>2.1.2</version> <reportSets> <reportSet> <reports> <report>cim</report> <!-- take too long time <report>dependencies</report> --> <report>dependency-convergence</report> <report>dependency-management</report> <!-- already present <report>index</report> --> <report>issue-tracking</report> <report>license</report> <report>mailing-list</report> <report>plugin-management</report> <report>plugins</report> <report>project-team</report> <report>scm</report> <report>summary</report> </reports> </reportSet> </reportSets> </plugin> </plugins> </reporting> <build> <defaultGoal>pdf:pdf</defaultGoal> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pdf-plugin</artifactId> <version>1.5.1</version> </plugin> </plugins> </build> </profile> ... </profiles> ... <project>