jenkins 配置findbugs

接着上一篇配置checkstyle的,今天来配置findbugs。
jinkens新建项目就略过了。 参考:[url]http://xfxlch.iteye.com/blog/2235248[/url]

重要步骤有:
1. 配置pom.xml文件。在pom里添加对findbugs plugin 的支持, 同时也添加了maven的site 插件,这样配置好之后,就可以生成findbugs的xml版本和html版本了。在build element中添加如下代码:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<reportPlugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
</plugin>
</reportPlugins>
</configuration>
</plugin>


然后执行命令:
[b]mvn clean compile site[/b]
查看target目录:

[img]http://dl2.iteye.com/upload/attachment/0110/9853/a7e0d762-e648-3a9a-a32c-5e6b5643ba1e.png[/img]

同样的执行命令:
[b]mvn clean compile site checkstyle:checkstyle[/b]
你也可以在site目录里拿到html文件,也就是checkstyle的report报告。

2. 在jenkins上配置findbugs.

[img]http://dl2.iteye.com/upload/attachment/0110/9860/28855c6f-c57e-3428-b2be-141bfe522f97.png[/img]

搞完之后,在build之后就可以看到findbugs的report了

[img]http://dl2.iteye.com/upload/attachment/0110/9862/6b353de7-e611-3cb0-bbf8-b63e7897fb30.png[/img]

参考阅读:
[url]http://stackoverflow.com/questions/8564208/how-to-generate-a-html-report-for-findbugs-with-maven-3-x[/url]

--EOF--
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值