淘宝商城(天猫)高级技术专家.3年研发+3年性能测试调优/系统测试+4年团队管理与测试架构、研发系统实践. 新舞台新气象, 深化测试基础架构及研发架构,希望能在某个技术领域成为真正的技术大牛。欢迎荐才http://bbs.51testing.com/viewthread.php?tid=120496&extra=&page=1 .邮件: jianzhao.liangjz@alibaba-inc.com,MSN:liangjianzhao@163.com.微博:http://t.sina.com.cn/1674816524

搭建CruiseControl2.8.2 +maven2.1+cobertura+checkstyle+findbug持续集成环境2

上一篇 / 下一篇  2009-06-05 22:56:02 / 个人分类:java性能监控与调优

第二步设置cruisecontrol config.xml

 

放置样例程序在: d:/cruisecontrol/maven_projects

 

根据http://bbs.scmroad.com/viewthread.php?tid=753&extra=page%3D1%20

http://bbs.scmroad.com/viewthread.php?tid=758

http://bbs.scmroad.com/viewthread.php?tid=836&extra=page%3D3

再精简config.xml

 

 

集成checkstyle.:

 

http://confluence.public.thoughtworks.org/display/CC/CheckStyle

 

集成corbertura:

http://confluence.public.thoughtworks.org/display/CC/CruiseControlWithCobertura

 

集成findbug:

http://mojo.codehaus.org/findbugs-maven-plugin/2.1-SNAPSHOT/usage.html配置maven pom.xml

http://confluence.public.thoughtworks.org/display/CC/CruiseControlWithFindBugs

 

 

集成其他工具:

http://confluence.public.thoughtworks.org/display/CC/IntegratingWithOtherTools

 

 

最后的配置文件cruisecontrol配置文件config.xml内容:

 

<cruisecontrol>

   <property name="cruisedir" value="D:/CruiseControl"/>  

   <property name="logdir" value="${cruisedir}/logs"/>  

   <property name="checkoutdir" value="${cruisedir}/maven_projects"/>  

   <property name="artifactdir" value="${cruisedir}/artifacts"/>  

   <property name="projectgoal" value="clean site package"/>  

   <property name="M2_EXE" value="D:/maven-2.1.0/bin/mvn.bat"/>  

   

   <plugin name="project">

                 <listeners>  

           <currentbuildstatuslistener file="${logdir}/${project.name}/status.txt"/>  

       </listeners>  

       <bootstrappers>  

           <svnbootstrapper localWorkingCopy="${checkoutdir}/${project.name}" />  

       </bootstrappers>  

       <modificationset quietperiod="30">  

           <svn localWorkingCopy="${checkoutdir}/${project.name}"/>  

       </modificationset>  

       <schedule interval="30">  

           <maven2 mvnscript="${M2_EXE}" 

                   pomfile="${checkoutdir}/${project.name}/pom.xml" 

                   goal="${projectgoal}"/>  

       </schedule>  

       <log dir="${logdir}/${project.name}">  

           <merge dir="${checkoutdir}/${project.name}/target/surefire-reports"/>  

       </log>  

       <publishers>  

           <onsuccess>  

               <artifactspublisher dest="${artifactdir}/${project.name}"   

                           file="${checkoutdir}/${project.name}/target/{project.name}.jar"/>  

           </onsuccess>  

          

 

       </publishers>  

       

             </plugin>

 

             <!--

   <project name="ch03-simple" />  

             -->

      

             <include.projects file="ch05-simple-web-proj.xml"/>

      

</cruisecontrol>

 

 

"ch05-simple-web-proj.xml"内容是:

 

 

 

<cruisecontrol>

 <property name="MY_PROJ_NAME" value="maven_projects/simple-webapp"/>

 <project name="simple-webapp">  

     

       <log>

                                   <merge file="${MY_PROJ_NAME}/target/checkstyle-result.xml"/>

                                    <merge file="${MY_PROJ_NAME}/target/pmd.xml"/>

                                    <merge dir="${MY_PROJ_NAME}/target/findbugsXml.xml"/>

 

                           </log>

       <schedule interval="40">  

           <maven2 mvnscript="${M2_EXE}" 

                   pomfile="${checkoutdir}/${project.name}/pom.xml" 

                   goal=" -U -Pexternal clean package site"/>  

       </schedule>  

       <publishers>  

             

           <onsuccess>  

                        

               <artifactspublisher dest="${artifactdir}/${project.name}"   

                           file="${checkoutdir}/${project.name}/target/simple-webapp.war"/>  

                          

                           

               <artifactspublisher

                                                dir="${MY_PROJ_NAME}/target/site" subdirectory="cobertura"

                                                dest="artifacts/${project.name}" />

  

           </onsuccess>

           

            

       </publishers>  

   </project>

   

   </cruisecontrol>  

 

 

最后界面展现:


TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

Open Toolbar