Apache Maven 报告执行器

通过MavenReportExecutor ( implementation )准备使用 Maven 3 执行报告插件的类:可以在maven-site-plugin的<configuration>元素或任何其他报告构建插件中配置报告插件,该插件具有与插件的List< ReportPlugin > 参数对应的以下 XML 模型:

<reportPlugins>
  <plugin>
    <groupId/>
    <artifactId/>
    <version/>
    <configuration/>
    <reports/>
    <reportSets>
      <reportSet>
        <id/>
        <configuration/>
        <reports/>
      </reportSet>
    </reportSets>
  </plugin>
</reportPlugins>

请注意,这是 POM <reporting>部分中插件的模型:

  • 没有<inherited>元素:此级别不支持报告插件配置继承(请参阅MSITE-484),
  • 在<reportSet>之外添加了额外的<reports>列表,在通常情况下简化了报告配置,
  • 带有可选的<version>:如果没有为报告插件指定版本,则版本由
    1. 在 pom 的build/plugins部分中搜索插件,
    2. 在 pom 的build/pluginManagement部分中搜索插件,
    3. 要求PluginVersionResolver获取回退版本并显示警告,因为它不推荐使用。

由于maven-reporting-exec 1.2(将由maven-site-plugin 3.4 使用),build/pluginManagement中的插件配置被注入到报告中。

Maven 3 核心通过ReportingConverter组件将<reporting> POM 部分(支持配置继承)自动转换为maven-site-pluginreportPlugins配置。