jenkins 配置findbugs

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

重要步骤有:
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>


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



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

2. 在jenkins上配置findbugs.



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



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

--EOF--


猜你喜欢

转载自xfxlch.iteye.com/blog/2235577