我使用的CruiseControl版本為2.8.2,這個版本是最新的版本,可能較以前的版本略有不同,但也是大同小異。
?
?
1. 安裝CruiseControl
?
先雙擊安裝文件,雙擊后,按提示,選擇你要安裝的路徑。安裝后,你所選擇的路徑下會出現一個CruiseControl的文件夾。比如我選擇的路徑是D:\CruiseControl。
?
?
?
目錄下面有一個apache-ant-1.7.0的目錄,是CruiseControl所集成Ant程序。?artifacts里面放了項目生成JAR文件,ect是CruiseControl內置的Jetty服務器的配置文件。lib里放了CruiseControl引用的一些庫。log文件夾不用說,是CruiseControl的操作日志,在Project文件夾中,我們可以放入我們要集成的項目。Webapp文件夾是Jetty應用程序的文件夾。
?
雙擊安裝目錄下有個cruisecontrol.bat的文件,就會啟動CruiseControl,CruiseControl用Jetty用為服務器,端口為8080,如果想要修改端口,可以修改etc/jetty.xml文件。?
啟動服務器后,用 http://localhost:8080/cruisecontrol/ 就可以訪問CruiseControl了。
?
默認的情況下,cruisecontrol下面有一個示例的項目:connectfour。
?
2.增加集成項目
?
首先把需要集成的項目,放入project文件里面。然后修改根目錄下的config.xml,在<cruisecontrol>結點下增加一個Project結點,如,我加入的項目為PuzzleWebWorld項目。則增加:
?
<project name="PuzzleWebWorld"> <listeners> <currentbuildstatuslistener file="logs/${project.name}/status.txt"/> </listeners> <bootstrappers> <antbootstrapper anthome="apache-ant-1.7.0" buildfile="projects/${project.name}/build.xml" target="default" /> </bootstrappers> <modificationset quietperiod="30"> <!-- touch any file in connectfour project to trigger a build --> <filesystem folder="projects/${project.name}"/> </modificationset> <schedule interval="20"> <ant anthome="apache-ant-1.7.0" buildfile="projects/${project.name}/build.xml"/> </schedule> <publishers> <onsuccess> <artifactspublisher dest="artifacts/${project.name}" file="projects/${project.name}/target/${project.name}.jar"/> </onsuccess> </publishers> </project>
?
這里要注意的是,你的項目根目錄下,必須有build.xml這個文件。
?
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
