1. cinfig.xml配置文件
<cruisecontrol>
  
<project name="hello"> 
   
<listeners>
     
<currentbuildstatuslistener file="logs/hello/status.txt" />
   
</listeners>
   
   
<bootstrappers>
     
<cvsbootstrapper localWorkingCopy="projects/hello" />
   
</bootstrappers>
   
<!—監(jiān)控本地工作目錄,如果在下面的目錄中發(fā)生變化則自動執(zhí)行下面的build.xml,沒有變化則不再執(zhí)行下面的構(gòu)建工作 -->
   
<modificationset quietperiod="30" > <!—監(jiān)控前的靜默 -->
     
<cvs localWorkingCopy="projects/hello"/>
     
<cvs localWorkingCopy="projects/hello/main/src/java/com/test/qik"/>
   
</modificationset>
   
<!—計劃時間間隔,單位秒 -->
   
<schedule interval="30" >
     
<ant anthome="apache-ant-1.6.3" 
       buildfile
="projects/hello/build.xml"
       target
="CI"/><!—構(gòu)建時執(zhí)行的build.xml -->
   
</schedule>
   
   
<log>
       
<merge dir="projects/hello/test-reports"/>
   
</log><!—記載日志報告的位置 -->
   
   
<publishers>
       
<artifactspublisher dest="artifacts" file="projects/hello/target/hello.jar"/>
   
</publishers><!—發(fā)布jar包的位置,我都是在build.xml中將jar包打好放在這個位置 -->
   
  
</project>
</cruisecontrol>

本人自己config.xml
<cruisecontrol>
    
<project name="CruiseControlTest" buildafterfailed="true"> 

        
<listeners>
            
<currentbuildstatuslistener file="logs/CruiseControlTest/status.txt"/>
        
</listeners>

        
<bootstrappers>
            
<antbootstrapper anthome="apache-ant-1.7.0" buildfile="projects/CruiseControlTest/build.xml" target="clean" />
            
<svnbootstrapper localWorkingCopy="projects/CruiseControlTest" />
        
</bootstrappers>

        
<modificationset quietperiod="30">
        
<!-- 系統(tǒng)自動檢查版本庫,如發(fā)生變化,這執(zhí)行update-->
            
<svn LocalWorkingCopy="projects/CruiseControlTest"  username="XXX" password="XXX"/>
        
</modificationset>

        
<schedule interval="30">
            
<ant anthome="apache-ant-1.7.0" buildfile="projects/CruiseControlTest/build.xml"/>
        
</schedule>

        
<log>
        
<!-- 此處位置一定要配置正確,CC才能正確的顯示測試結(jié)果,否則,CC只會用行測試用例,但是報告No Tests Run  
                 This project doesn't have any tests  
             
-->
            
<merge dir="projects/CruiseControlTest/target/test-results"/>
        
</log>

        
<publishers>
            
<onsuccess>
                
<artifactspublisher dest="artifacts/CruiseControlTest" file="projects/CruiseControlTest/target/CruiseControlTest.jar"/>
            
</onsuccess>
            
<email mailhost="example.cn" returnaddress="system@example.cn" 
                  skipusers
="true"   subjectprefix="[CruiseControl]" 
                  buildresultsurl
="http://localhost:8888/buildresults/CruiseControlTest" > 
                  
<failure address="system@example.cn" />  
                  
<success address="system@example.cn" />  
            
</email>
        
</publishers>

    
</project>
</cruisecontrol>