我使用的CruiseControl版本為2.8.2,這個(gè)版本是最新的版本,可能較以前的版本略有不同,但也是大同小異。
?
?
1. 安裝CruiseControl
?
先雙擊安裝文件,雙擊后,按提示,選擇你要安裝的路徑。安裝后,你所選擇的路徑下會(huì)出現(xiàn)一個(gè)CruiseControl的文件夾。比如我選擇的路徑是D:\CruiseControl。
?
?
?
目錄下面有一個(gè)apache-ant-1.7.0的目錄,是CruiseControl所集成Ant程序。?artifacts里面放了項(xiàng)目生成JAR文件,ect是CruiseControl內(nèi)置的Jetty服務(wù)器的配置文件。lib里放了CruiseControl引用的一些庫(kù)。log文件夾不用說(shuō),是CruiseControl的操作日志,在Project文件夾中,我們可以放入我們要集成的項(xiàng)目。Webapp文件夾是Jetty應(yīng)用程序的文件夾。
?
雙擊安裝目錄下有個(gè)cruisecontrol.bat的文件,就會(huì)啟動(dòng)CruiseControl,CruiseControl用Jetty用為服務(wù)器,端口為8080,如果想要修改端口,可以修改etc/jetty.xml文件。?
啟動(dòng)服務(wù)器后,用 http://localhost:8080/cruisecontrol/ 就可以訪問(wèn)CruiseControl了。
?
默認(rèn)的情況下,cruisecontrol下面有一個(gè)示例的項(xiàng)目:connectfour。
?
2.增加集成項(xiàng)目
?
首先把需要集成的項(xiàng)目,放入project文件里面。然后修改根目錄下的config.xml,在<cruisecontrol>結(jié)點(diǎn)下增加一個(gè)Project結(jié)點(diǎn),如,我加入的項(xiàng)目為PuzzleWebWorld項(xiàng)目。則增加:
?
<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>
?
這里要注意的是,你的項(xiàng)目根目錄下,必須有build.xml這個(gè)文件。
?
更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主
微信掃碼或搜索:z360901061

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