国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 開發(fā)設(shè)計(jì) > 正文

持續(xù)集成 Java手冊

2019-11-18 11:20:18
字體:
供稿:網(wǎng)友

持續(xù)集成 java手冊

一、概念

Martin Fowler的文章:Continuous Integration  中文翻譯:持續(xù)集成

二、工具

傳統(tǒng)工具:VisualStudio.Net,VisualSourceSafe,Rational ClearCase

自動(dòng)編譯工具:Ant

回歸測試工具:JUnit

代碼檢查工具:CheckStyle

持續(xù)集成工具:CruiseControl

三、步驟

  • CruiseControl監(jiān)控遠(yuǎn)程版本控制系統(tǒng)的變化

  • 變化發(fā)生時(shí)CruiseControl調(diào)用編譯工具進(jìn)行編譯(Ant等)

  • 編譯成功后調(diào)用JUnit進(jìn)行回歸測試

  • 編譯成功后調(diào)用CheckStyle進(jìn)行代碼檢查

  • 完畢后將編譯結(jié)果、測試結(jié)果、代碼檢查結(jié)果發(fā)送至開發(fā)人員、主管經(jīng)理,并發(fā)布至網(wǎng)站,甚至報(bào)警器

    所有這一切都是按照編制好的腳本自動(dòng)進(jìn)行的

四、實(shí)施示例

目前我們使用的是ClearCase,主控軟件為CruiseControl,其腳本文件為cccc.xml

  • 配置遠(yuǎn)程版本控制系統(tǒng)

<modificationset quietperiod="30">
  <clearcase branch="main" viewpath="D:/cc_view/chelseafc/NUCleus2.0/Port" recursive="true" />
  </modificationset>
  • 配置編譯工具

<schedule interval="30">
  <ant antscr
- <Htmlemail mailhost="mail.chelseafc.com.cn" returnaddress="workflow_engine@chelseafc.com.cn" subjectjsp/xsl" CSS="F:/software/Agile.Net/cruisecontrol-2.2/reporting/jsp/css/cruisecontrol.css" logdir="D:/Tomcat 4.1/webapps/cruisecontrol/samplelogs">
  <always address="chelsea@chelseafc.com.cn" />
  <always address="Ajax@chelseafc.com.cn" />
  <map alias="chelsea" address="chelsea@chelseafc.com.cn" />
  </htmlemail>
  </publishers>
  • 其中CruiseControl暫時(shí)沒有提供代碼檢查工具的支持,建議使用Ant來調(diào)用CheckStyle,示例如下(沒有真正運(yùn)行過):
<target name="web.checkstyle">
  <mkdir dir="${target.temp}/checkstyle" />
  <mkdir dir="${target.web}/checkstyle" />
- <taskdef resource="checkstyletask.properties">
- <classpath>
  <fileset dir="${support.tools}/checkstyle31" includes="**/*.jar" />
  </classpath>
  </taskdef>
- <copy file="${support.tools}/checkstyle31/custom.xml" overwrite="true" tofile="${target.temp}/checkstyle/custom.xml">
- <filterset>
  <filter token="source.java" value="${basedir}/${source.java}" />
  <filter token="target.checkstyle" value="${basedir}/${target.temp}/checkstyle" />
  </filterset>
  </copy>
- <checkstyle config="${target.temp}/checkstyle/custom.xml" failOnViolation="false">
  <fileset dir="${source.java}/main" includes="**/*.java" />
  <formatter type="plain" />
  <formatter type="xml" toFile="${target.temp}/checkstyle/checkstyle_errors.xml" />
  </checkstyle>
  <style basedir="${target.temp}/checkstyle" destdir="${target.web}/checkstyle" includes="checkstyle_errors.xml" style="${support.tools}/checkstyle31/checkstyle-noframes.xsl" />
  </target>

五、幾點(diǎn)提示

  • CruiseControl會(huì)自動(dòng)根據(jù)本地ClearCase的View監(jiān)控遠(yuǎn)程VOB
  • 其實(shí)除了監(jiān)控遠(yuǎn)程版本控制系統(tǒng)外其它的任務(wù)都可以由Ant來完成,CC只負(fù)責(zé)監(jiān)控變化并調(diào)用Ant即可
  • 可以為cruisecontrol.bat加入啟動(dòng)參數(shù)“-port 8055”,這樣可以用JMX(http://localhost:8055)來控制cc
  • 最好避免中文路徑,否則就需要手工為幾個(gè)Xml格式的文件,如cc的report Servlet的Web.xml等加入編碼方式“<?xml version="1.0" encoding="UTF-8" ?> ”,或者將中文路徑映射為虛擬硬盤:“subst Y: "D:/cc_view/chelsea/Platform/開發(fā)/Nucleus2.0/Source"”
  • 中文log無法正常顯示時(shí),需要設(shè)置CruiseControl配置文件中<log>元素的“encoding”屬性,如:
    <log dir="D:/Tomcat 4.1/webapps/cruisecontrol/samplelogs" encoding="utf-8">
      <merge dir="D:/cc_view/chelseafc/Nucleus2.0/Port/test-results" />
    </log>
  • 編譯失敗后,在下次checkin之前,一般不需要重新編譯,這時(shí)可設(shè)置<project >的“buildafterfailed”屬性為false來避免重新編譯
  • <htmlemail>的幾個(gè)屬性似乎沒有缺省設(shè)置,雖然文檔里說從2.1.7開始有缺省設(shè)置,包括xsldir,css,logdir
  • 各種工具的安裝、使用,在各自的文檔里都非常具體,網(wǎng)上亦有無數(shù)資源

六、參考資料

  • DailyBuild全攻略
  • Draco.Net
  • 持續(xù)集成.Net手冊



發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 五原县| 铜陵市| 大宁县| 浦江县| 金华市| 额济纳旗| 织金县| 东丰县| 宁远县| 饶河县| 同心县| 元阳县| 象州县| 丰顺县| 东莞市| 大庆市| 叙永县| 邳州市| 乌鲁木齐县| 剑河县| 长治市| 大悟县| 清流县| 嘉鱼县| 塘沽区| 安远县| 綦江县| 九寨沟县| 中超| 葵青区| 双牌县| 车致| 迁西县| 房山区| 始兴县| 伊宁市| 寻乌县| 启东市| 布尔津县| 朝阳县| 任丘市|