Apache Maven 站点插件

站点插件用于为项目生成站点。生成的站点还包括在 POM 中配置的项目报告。

这是maven-site-plugin版本 3的站点。它至少需要 Maven $ prerequisiteMavenVersion才能运行。如果您正在寻找第 2 版,您可以在此处找到它。

如果您想从以前的版本升级,请阅读迁移指南。

目标概述

站点插件有七个目标:

  • site:site用于为单个项目生成站点。请注意,多模块构建中的模块站点之间的链接将不起作用,因为本地构建目录结构与部署站点不匹配。
  • site:deploy用于使用 Wagon 支持的协议将生成的站点部署到 POM 的<distributionManagement>部分中指定的站点 URL。
  • site:run启动站点,根据要求呈现文档以加快编辑速度。它使用 Jetty 作为 Web 服务器。
  • site:stage根据在 POM 的<distributionManagement>部分中指定的站点 URL 在本地暂存或模拟目录中生成站点。它可用于测试多模块构建工作中模块站点之间的链接。此目标要求站点已经使用站点目标生成,例如通过调用mvn site
  • site:stage-deploy将生成的站点部署到 POM 的<distributionManagement>部分中指定的站点 URL 的登台或模拟目录。
  • site:attach-descriptor将站点描述符 ( site.xml ) 添加到要安装/部署的文件列表中。有关站点描述符的更多参考,这里有一个链接
  • site:jar将站点输出捆绑到 JAR 中,以便可以将其部署到存储库。
  • site:effective-site在继承和插值之后计算有效站点描述符。

用法

关于如何使用站点插件的一般说明可以在使用页面上找到。下面给出的示例中描述了一些更具体的用例。

如果您对插件的使用仍有疑问,请查看常见问题解答并随时联系用户邮件列表。邮件列表中的帖子已存档,并且可能已经包含您问题的答案,作为旧线程的一部分。因此,也值得浏览/搜索邮件存档

If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our issue tracker. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. Of course, patches are welcome, too. Contributors can check out the project from our source repository and will find supplementary information in the guide to helping with Maven.