




下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領
文檔簡介
第第頁持續(xù)集成Java手冊持續(xù)集成Java手冊
發(fā)表于:2023-07-04來源::點擊數(shù):標簽:
持續(xù)集成Java手冊一、概念MartinFowler的文章:ContinuousIntegration中文翻譯:持續(xù)集成二、工具傳統(tǒng)工具:VisualStudio.Net,VisualSourceSafe,RationalClearCase自動編譯工具:Ant回歸測試工具:JUnit代碼檢查工具:CheckStyle持續(xù)集成
持續(xù)集成Java手冊
一、概念
MartinFowler的文章:ContinuousIntegration中文翻譯:持續(xù)集成
二、工具
傳統(tǒng)工具:VisualStudio.Net,VisualSourceSafe,RationalClearCase
自動編譯工具:Ant
回歸測試工具:JUnit
代碼檢查工具:CheckStyle
持續(xù)集成工具:CruiseControl
三、步驟
CruiseControl監(jiān)控遠程版本控制系統(tǒng)的變化
變化發(fā)生時CruiseControl調(diào)用編譯工具進行編譯(Ant等)
編譯成功后調(diào)用JUnit進行回歸測試
編譯成功后調(diào)用CheckStyle進行代碼檢查
完畢后將編譯結(jié)果、測試結(jié)果、代碼檢查結(jié)果發(fā)送至開發(fā)人員、主管經(jīng)理,并發(fā)布至網(wǎng)站,甚至報警器
所有這一切都是按照編制好的腳本自動進行的
四、實施示例
目前我們使用的是ClearCase,主控軟件為CruiseControl,其腳本文件為cccc.xml
配置遠程版本控制系統(tǒng)
modificationsetquietperiod=30
clearcasebranch=mainviewpath=D:\cc_view\chelseafc\Nucleus2.0\Portrecursive=true/
/modificationset
配置編譯工具
scheduleinterval=30
antantscript=C:\Java\JBuilder2023\thirdparty\ant\bin\ant.batbuildfile=D:\cc_view\chelseafc\Nucleus2.0\Port\clearcase-build.xmltarget=cleanbuildmultiple=1/
/schedule
配置測試用例(在ant的配置文件中)
targetname=testdepends=initdescription=Rununittests
deletedir=${junit.results}/
mkdirdir=${junit.results}/
-junitfork=yeshaltonfailure=yes
-classpath
pathelementlocation=${build.dir}/
/classpath
formattertype=plainusefile=false/
formattertype=xml/
-batchtesttodir=${junit.results}
filesetdir=${build.dir}includes=**/*Test.class/
/batchtest
/junit
/target
配置報告形式
publishers
currentbuildstatuspublisherfile=currentbuild.txt/
-htmlemailmailhost=returnaddress=workflow_engine@subjectprefix=ContinuousIntegration:buildresultsurl=http://chelsea:8044/cruisecontrol/buildresultsspamwhilebroken=truexsldir=F:\software\Agile.Net\cruisecontrol-2.2\reporting\jsp\xslcss=F:\software\Agile.Net\cruisecontrol-2.2\reporting\jsp\css\cruisecontrol.csslogdir=D:\Tomcat4.1\webapps\cruisecontrol\samplelogs
alwaysaddress=chelsea@/
alwaysaddress=ajax@/
mapalias=chelseaaddress=chelsea@/
/htmlemail
/publishers
其中CruiseControl暫時沒有提供代碼檢查工具的支持,建議使用Ant來調(diào)用CheckStyle,示例如下(沒有真正運行過):
targetname=web.checkstyle
mkdirdir=${target.temp}/checkstyle/
mkdirdir=${target.web}/checkstyle/
-taskdefresource=perties
-classpath
filesetdir=${support.tools}/checkstyle31includes=**/*.jar/
/classpath
/taskdef
-copyfile=${support.tools}/checkstyle31/custom.xmloverwrite=truetofile=${target.temp}/checkstyle/custom.xml
-filterset
filtertoken=source.javavalue=${basedir}/${source.java}/
filtertoken=target.checkstylevalue=${basedir}/${target.temp}/checkstyle/
/filterset
/copy
-checkstyleconfig=${target.temp}/checkstyle/custom.xmlfailOnViolation=false
filesetdir=${source.java}/mainincludes=**/*.java/
formattertype=plain/
formattertype=xmltoFile=${target.temp}/checkstyle/checkstyle_errors.xml/
/checkstyle
stylebasedir=${target.temp}/checkstyledestdir=${target.web}/checkstyleincludes=checkstyle_errors.xmlstyle=${support.tools}/checkstyle31/checkstyle-noframes.xsl/
/target
五、幾點提示
CruiseControl會自動根據(jù)本地ClearCase的View監(jiān)控遠程VOB
其實除了監(jiān)控遠程版本控制系統(tǒng)外其它的任務都可以由Ant來完成,CC只負責監(jiān)控變化并調(diào)用Ant即可
可以為cruisecontrol.bat加入啟動參數(shù)“-port8055”,這樣可以用JMX(http://localhost:8055)來控制cc
最好避免中文路徑,否則就需要手工為幾個Xml格式的文件,如cc的reportServlet的Web.xml等加入編碼方式“?xmlversion=1.0encoding=UTF-8?”,或者將中文路徑映射為虛擬硬盤:“substY:D:\cc_view\chelsea\Platform\開發(fā)\Nucleus2.0\Source”
中文log無法正常顯示時,需要設置CruiseControl配置文件中l(wèi)og元素的“encoding”屬性,如:
logdir=D:\Tomcat4.1\webapps\cruisecontrol\samplelogsencoding=utf-8
mergedir=D:\cc_view\chelseafc\Nucleus2.0\Port\test-results/
/log
編譯失敗后,在下次checkin之前,一般不需要重新編譯,這時可設置
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 共用深水井免責協(xié)議書
- 防水材料承包協(xié)議書
- 營業(yè)執(zhí)照轉(zhuǎn)讓協(xié)議書
- 車站進站加班協(xié)議書
- 解除擔保責任協(xié)議書
- 銷售人員安全協(xié)議書
- 車位優(yōu)惠費用協(xié)議書
- 骨腫瘤營養(yǎng)管理
- 贈送車位保密協(xié)議書
- 裁判公正制裁協(xié)議書
- GB 45672-2025車載事故緊急呼叫系統(tǒng)
- 規(guī)劃測量協(xié)議書
- 模具開發(fā)保密協(xié)議書
- DB41T 2794-2024高速公路隧道和高邊坡監(jiān)測技術(shù)指南
- 2025年會展經(jīng)濟與管理考試試題及答案
- 2025年護士考試安全管理試題及答案
- 2024秋招北森題庫數(shù)學百題
- 福州地鐵考試試題及答案
- 鋼材授權(quán)合同協(xié)議
- 小學生朗讀指導課件
- 倍智tas人才測評系統(tǒng)題庫及答案
評論
0/150
提交評論