自定义文本报告

实际上,所有报告都有一个静态渲染器,只有文本可以更改。

注意:此功能仅在此插件的 2.3+ 版本中可用。

<project>
  ...
  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>2.6</version>
        <configuration>
          <!-- By default -->
          <customBundle>${project.basedir}/src/site/custom/project-info-report.properties</customBundle>
        </configuration>
      </plugin>
      ...
    </plugins>
  </reporting>
  ...
</project>

要更改报告中的文本,您应该从http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-project-info-reports-plugin/src/main导入默认的 Project Info 报告包/resources/并编辑它们。例如,如果要修改邮件列表介绍,则应编辑 report.mailing-lists.intro 属性。

默认捆绑包project-info-report.properties的提取:

report.mailing-lists.intro = These are the mailing lists that have been established for this project. For each list, there is a subscribe, unsubscribe, and an archive link.

Apache Commons 项目的自定义包 ${project.basedir}/src/site/custom/project-info-report.properties 的提取:

report.mailing-lists.intro = These are the mailing lists that have been established for this project. For each list, there is a subscribe, unsubscribe, and an archive link.\
        <p>\
            有关使用 Commons 组件的问题应发布到\
            <a href="http://mail-archives.apache.org/mod_mbox/commons-user/" class="externalLink">用户列表</a>.\
            <br>\
            <a href="http://mail-archives.apache.org/mod_mbox/commons-dev/" class="externalLink">开发者列表</a>\
            用于与 Commons 组件开发相关的问题和讨论。\
            <br>\
            请不要交叉发布;开发人员也订阅了用户列表。\
            如果您的问题已经得到解答,请先阅读档案。\
            如果没有,请订阅相应的列表并发布您的问题。\
        </p>\
        <p>
            <strong>注意:</strong>请不要将补丁或附件发送到任何邮件列表。\
            最好通过<i>问题跟踪</i>系统处理补丁。\
            否则,请将文件上传到公共服务器并在邮件中包含 URL。\
        </p>\
        <p>\
            请阅读<a href="http://www.apache.org/foundation/public-archives.html" class="externalLink">公共论坛存档政策</a>\
            和 <a href="http://www.apache.org/dev/contrib-email-tips.html" class="externalLink">电子邮件投稿人提示</a>。\
            <br>\
            有关 Apache 邮件列表的更多信息,请阅读\
            <a href="http://www.apache.org/foundation/mailinglists.html" class="externalLink">一般邮件列表信息</a>\
            特别是标题为\的部分
            <a href="http://www.apache.org/foundation/mailinglists.html#subscribe" class="externalLink">订阅和退订</a>\
        </p>

笔记:

  1. 您还可以在消息中使用 Maven 属性(即 ${project.artifactId})。
  2. 如果您的自定义包中未定义包属性,则将显示默认值。