【转载】hudson clover 使用
【来源】 http://rdc.taobao.com/blog/qa/?author=83&paged=2
hudson是一个好东东,在上面如何集成clover呢?最近研究了一下,下面分享一下这个过程。
一、Clover插件安装:
Manage Hudson –》Manage Plugins 找到clover安装(安装按纽在页面右下方,有的浏览器要拖很长才能看到),
重启glassfish就行了,重启地址:http://$ip:$port/common/applications/applications.jsf
二、项目配置:
进入到项目配置界面:会看到在 Build Environment 多出一条,如下较图:
但这个不用管他,因为,我们只有maven ,这个只能用于ant。
Build的部分做一下调整,如下图:
最后在“Post-build Actions” 选中多出来的 “ Publish JUnit test result report”进行勾选,如图
Clover report directory :要指定项目 主(父)pom 所在目录的target/site/clover
接一下就要设一下相关的指标。
三、项目主(父)pom配置
与CC一样,加一下plugin,例如:
<plugin> <groupId>com.atlassian.maven.plugins</groupId> <artifactId>maven-clover2-plugin</artifactId> <version>2.5.1</version> <configuration> <includesTestSourceRoots>true</includesTestSourceRoots> <generateHistorical>true</generateHistorical> <encoding>GBK</encoding> <licenseLocation>/xx/xx.license</licenseLocation> </configuration> </plugin>