天天看點

一步一步搞定hudson+ant+JUNIT+EMMA 持續內建(CI)伺服器環境搭建(1)

1.安裝tomcat     1.1 wget tomcat     1.2 tar -zxvf .... 2.安裝ant    2.1 wget ant    2.2 tar -zxvf    2.3添加環境變量  vi /etc/profile -->i --最後插入  eport ANT_HOME=/root/soft/apache-ant-1.8.4 -->esc,:wq!         --->儲存,退出,然後運作:

                #source /etc/profile

                不報錯則成功。 3.安裝hudson     下載下傳hudson包之後,然後解壓将war包,丢到tomcat就OK了.     比較好的資料:  Hudson + Ant + SVN + Tomcat配置詳解 - Geeeeeeek - 部落格園     按照此文章,基本沒有問題.下面是我遇到的幾個問題.   A:      改預設目錄:找到tomcat/webapp/huson/WEB-INF/web.xml  (如果沒有該目錄,先運作一次tomcat)         找到如下結點:       <env-entry>             <env-entry-name>HUDSON_HOME</env-entry-name>             <env-entry-type>java.lang.String</env-entry-type>             <env-entry-value></env-entry-value>       </env-entry>          <env-entry-value></env-entry-value>         --->改成:<env-entry-value>/opt/app/hudson</env-entry-value>       然後重新開機tomcat即可.    B:系統設定從出現如下資訊:         Your container doesn't use UTF-8 to decode URLs. If you use non-ASCII characters as a job name etc, this will cause problems. See Containers         and                  Tomcat i18n for more details.         想修複這個問題,可以在 Tomcat 的伺服器配置檔案中添加 URIEncoding 屬性。

        找到tomcat的配置檔案server.xml裡找到如下結點

        <Connector port="8080" protocol="HTTP/1.1"

               connectionTimeout="20000"                redirectPort="8443"/>

        在最後添加如下屬性:URIEncoding="UTF-8" . 如下:

        <Connector port="8080" protocol="HTTP/1.1"                connectionTimeout="20000"                redirectPort="8443" URIEncoding="UTF-8"/> 2.配置hudson     參照 Hudson使用參考手冊V1.1 - 豆丁網 3.下載下傳EMMA插件     選中點安裝即可.如果不能連接配接外網的話,從外網采用下載下傳方式,将下面來的hpi傳到伺服器.然後重新開機即可 4.建立項目,然後build即可.-------->見第二篇.     其實最主要是的利用項目的ant腳本. (本人其它一些文章,可到 http://www.wejias.com進行閱讀)