hudson 集成maven findbugs junit

读这篇blog的前提是你已经装好了 hudson 并且添加了maven findbugs 和junit 插件

hudson版本是2.01 

maven版本是3.0.3

findbugs版本是 1.3.9

junit版本是4.5.0

 

第一步新建项目

第二步配置项目

 

 

.......

 

上一篇blog 说了怎么配置

http://www.cnblogs.com/SXLBlog/archive/2011/06/14/2080270.html

 

这个版本的findbugs插件是用maven来管理的当然junit也是,这些配置都是放在maven 的配置文件pom.xml当中的 ,

 

< build >
      
< plugins >
          
< plugin >
              
< groupId > org.codehaus.mojo </ groupId >
              
< artifactId > findbugs-maven-plugin </ artifactId >
              
< version > 2.3.2 </ version >
              
< configuration >
                      
< findbugsXmlOutput > true </ findbugsXmlOutput >
                    
< findbugsXmlWithMessages > true </ findbugsXmlWithMessages >
                    
< xmlOutput > true </ xmlOutput >
                    
< findbugsXmlOutputDirectory > target/site </ findbugsXmlOutputDirectory >
              
</ configuration >
          
</ plugin >
      
</ plugins >
  
</ build >
  
< dependencies >
    
< dependency >
      
< groupId > junit </ groupId >
      
< artifactId > junit </ artifactId >
      
< version > 4.4 </ version >
      
< scope > test </ scope >
    
</ dependency >
  
</ dependencies >

 这就是在pom.xml 当中配置findbugs 和jnuit  的代码.

 

               < configuration >
                      
< findbugsXmlOutput > true </ findbugsXmlOutput >
                    
< findbugsXmlWithMessages > true </ findbugsXmlWithMessages >
                    
< xmlOutput > true </ xmlOutput >
                    
< findbugsXmlOutputDirectory > target/site </ findbugsXmlOutputDirectory >
              
</ configuration >

 这里配置了findbugs是否输出检查后的文件,上面三条照抄,最后一条根据自己需求修改这是输出的xml的路径,相对于项目根目录..

junit的配置需要注意的是<scope></scope> 这里是作用范围,test 是项目的名称.

这样配置完成之后hudson构建的时候会调用junit 进行测试,但是不会去调用findbugs 这里需要在hudson的任务设置里面配置一下

 

在Goals and options 中加上maven运行时的命令  clean findbugs:findbugs 

 

这就Ok了,,构建一下就会出现

这些,,上面出现findbugs的检查输出,和modulebuilds 是junit的测试的类,Test Result  是测试结果...

 

 

 

 

转载于:https://www.cnblogs.com/SXLBlog/archive/2011/06/15/2081384.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值