... ...
org.apache.maven.plugins
maven-site-plugin
3.3
... ...
2.配置正确版本之后,在项目之下运行mvn site就能直接生成一个最简单的站点;
C:\Users\chengxiang.peng.QUNARSERVERS\QunarGitSources\phone_spider_project>mvn site
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building check phone 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-site-plugin:3.3:site (default-site) @ phoneproject ---
[WARNING] Report plugin org.apache.maven.plugins:maven-project-info-reports-plugin has an empty version.
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[INFO] configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:2.9
[WARNING] No project URL defined - decoration links will not be relativized!
[INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
[INFO] Generating "Dependencies" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "Dependency Convergence" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "Dependency Information" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "About" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "Plugin Management" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "Plugins" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "Summary" report --- maven-project-info-reports-plugin:2.9
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 29.989 s
[INFO] Finished at: 2016-10-20T12:09:41+08:00
[INFO] Final Memory: 26M/357M
[INFO] ------------------------------------------------------------------------
3.待Maven运行完成后,可以再项目的target/site/目录下找到Maven生成的站点文件,包括dependencies.html、dependency-convergence.html、index.html和css、images文件夹;
... ...
http://phoneproject.qunar.com
check phone description.
scm:git:http://gitlab.corp.chengxiang.com/mobile_hotel_res/phone_spider_project
scm:git:[email protected]:mobile_hotel_res/phone_spider_project.git
http://gitlab.corp.chengxiang.com/mobile_hotel_res/phone_spider_project
Jenkins
http://ci.chengxiang.com/phoneproject
chengxiang.peng
chengxiang.peng
[email protected]
8
JIRA
http://jira.chengxiang.com/phoneproject
... ...
3.执行mvn site重新生成站点,发现对比简单站点,多生成了如 "CI Management" report、"Source Code Management" report等;
C:\Users\chengxiang.peng.QUNARSERVERS\QunarGitSources\phone_spider_project>mvn site
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building check phone 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-site-plugin:3.3:site (default-site) @ phoneproject ---
[WARNING] Report plugin org.apache.maven.plugins:maven-project-info-reports-plugin has an empty version.
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[INFO] configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:2.9
[INFO] Relativizing decoration links with respect to project URL: http://phoneproject.qunar.com
[INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
//新增的报告生成
[INFO] Generating "CI Management" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "Dependencies" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "Dependency Convergence" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "Dependency Information" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "About" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "Issue Management" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "Plugin Management" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "Plugins" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "Team" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "Source Code Management" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "Summary" report --- maven-project-info-reports-plugin:2.9
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 19.624 s
[INFO] Finished at: 2016-10-20T15:21:46+08:00
[INFO] Final Memory: 26M/354M
[INFO] ------------------------------------------------------------------------
3.有些时候,我们并不需要生成某些项目信息,如可能不想公开源码仓库信息。可以通过maven-project-info-reports-plugin选择性生成信息项目,pom.xml配置如下:
... ...
org.apache.maven.plugins
maven-project-info-reports-plugin
2.9
dependencies
project-team
... ...
4.mvn site生成站点:
C:\Users\chengxiang.peng.QUNARSERVERS\QunarGitSources\phone_spider_project>mvn site
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building check phone 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-site-plugin:3.3:site (default-site) @ phoneproject ---
[INFO] configuring report plugin org.apache.maven.plugins:maven-project-info-reports-plugin:2.9
[INFO] Relativizing decoration links with respect to project URL: http://phoneproject.qunar.com
[INFO] Rendering site with org.apache.maven.skins:maven-default-skin:jar:1.0 skin.
//只生成了上面配置的Dependencies和Team报告
[INFO] Generating "Dependencies" report --- maven-project-info-reports-plugin:2.9
[INFO] Generating "Team" report --- maven-project-info-reports-plugin:2.9
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.054 s
[INFO] Finished at: 2016-10-20T15:30:33+08:00
[INFO] Final Memory: 24M/275M
[INFO] ------------------------------------------------------------------------
三、项目报告插件
... ...
org.apache.maven.plugins
maven-javadoc-plugin
2.7
... ...
执行mvn site生成站点中,包含javadoc文档Project Reports->JavaDocs如下:
2.Source Xref:能够随时随地打开浏览器访问项目的最新源代码;
pom.xml配置:
... ...
org.apache.maven.plugins
maven-jxr-plugin
2.2
org.apache.maven.plugins
maven-jxr-plugin
2.2
... ...
执行mvn site生成站点中,包含源码文档Project Reports->Source Xref如下:
... ...
org.apache.maven.plugins
maven-checkstyle-plugin
2.5
${project.basedir}/config/checkstyle/checkstyle.xml
org.apache.maven.plugins
maven-checkstyle-plugin
2.5
${project.basedir}/config/checkstyle/checkstyle.xml
... ...
Checkstyle.xml配置如下(详细配置信息,查看官方文档:http://checkstyle.sourceforge.net/checks.html):
… ….
… …..
执行mvn site生成站点中,包含源码文档Project Reports->CheckStyle如下:
... ...
org.apache.maven.plugins
maven-pmd-plugin
3.7
org.apache.maven.plugins
maven-pmd-plugin
3.7
... ...
执行mvn site生成站点中,包含源码文档Project Reports->PMD如下:
... ...
org.apache.maven.plugins
cobertura-maven-plugin
2.7
org.apache.maven.plugins
cobertura-maven-plugin
2.7
... ...
执行mvn site生成站点中,包含源码文档Project Reports->Coberatura Test如下:
Phone Site
http://tika.apache.org/asf-logo.gif
http://www.baidu.com
java
images/right.jpg
http://www.hao123.com
com.googlecode.fluido-skin
fluido-skin
1.3
src/site/fml/faqtest.fml文件(一种用来创建FAQ页面的XML文档格式)
title1
what?
answer1
answer2
src/site/apt/apttest.apt文件(一种类似于维基的文档格式,用它来快速创建简单而又结构丰富的文档)
what is apt?
* aaaa
* bbbb
3.执行mvn site生成站点中,生成自定义站点如下:
... ...
UTF-8
UTF-8
org.apache.maven.plugins
maven-site-plugin
3.3
zh_CN
... ....
3.执行mvn site生成站点中,生成本地化站点如下: