1. 下载clover.license
(1) clover.license申请网址:
http://www.atlassian.com/software/clover/CloverDownloadCenter.jspa
(2)把clover.license拷贝到hudson slave机器上,例如放到/home/yulin/tools/ 目录下
2. maven项目clover插件配置
(1)修改项目的主pom.xml文件,添加如下代码
3. maven项目 hudson配置
(1)在hudson上新建
Build a maven2 project
任务,命名为xxx(项目名)-clover
(2)在Build中选择 maven2,和填写如下maven命令
(3)选择Publish Clover Coverage Report并填写相应的数值,例如:
- <plugin>
- <groupId>com.atlassian.maven.plugins</groupId>
- <artifactId>maven-clover2-plugin</artifactId>
- <version>1.0.0.nl-SNAPSHOT</version>
- <configuration>
- <includesTestSourceRoots>true</includesTestSourceRoots>
- <generateHistorical>true</generateHistorical>
- <encoding>GBK</encoding>
- <licenseLocation>${clover.license}</licenseLocation>
- </configuration>
- </plugin>
- clean
- install
- -DskipTests
- |
- -Phudson-web
- clover2:setup
- test
- clover2:aggregate
- clover2:clover
- -Dmaven.test.failure.ignore
- -Dclover.license.file=/home/yulin/tools/clover.license