使用ANT實現對web項目的自動更新 編譯 打包

來源:互聯網
上載者:User

標籤:des   blog   http   java   使用   io   ar   伺服器   

在伺服器上無法使用eclipse來打包。需採用ant方式
附件中是ant所需要的svn外掛程式 並在ant/lib下面刪除:svnjavahl.jar,javasvn.jar
http://panyongzheng.iteye.com/blog/1271184
<?xml version="1.0" encoding="UTF-8"?><project name="cim" default="deploy" basedir="."><property name="webapp.name"    value="cim"/><property name="catalina.home" value="C:\apache-tomcat-6.0.35"/><property name="dist.dir" value="C:\Users\shengra\Desktop"/><property name="ant.home" value="C:\apache-ant-1.8.2" /><property name="webRoot.dir"    value="${basedir}/${webapp.name}/WebRoot"/><property name="src.dir"      value="${basedir}/${webapp.name}/src"/><property name="lib.dir"    value="${webRoot.dir}/WEB-INF/lib"/><property name="class.dir"    value="${webRoot.dir}/WEB-INF/classes"/><property name="svn.UserName" value="rao.sheng" /><property name="svn.UserPassword" value="password" /><property name="svn.URL" value="https://ucmdb-int-ld01/svn/ucmdb-int/LeverageUCMDB/trunk/CIM/dev" /><property name="svn.Dist" value="${basedir}" /><!-- SVN ANT --><path id="ant.svn.classpath"><fileset dir="${ant.home}/lib"><include name="*.jar" /></fileset></path><taskdef name="svn" classname="org.tigris.subversion.svnant.SvnTask"><classpath refid="ant.svn.classpath" /></taskdef><target name="checkout" description="checkout full web project"><svn username="${svn.UserName}" password="${svn.UserPassword}"><checkout url="${svn.URL}" revision="HEAD" destPath="${svn.Dist}" /></svn></target><path id="compile.classpath"><fileset dir="${catalina.home}/lib"><include name="*.jar"/></fileset><fileset dir="${lib.dir}"><include name="*.jar"/></fileset></path><target name="test"><echo>${class.dir}</echo></target><target name="clean" depends="checkout"><delete dir="${class.dir}"/></target><target name="compile" depends="clean"><mkdir dir="${class.dir}"/><javac srcdir="${src.dir}"  destdir="${class.dir}"><classpath refid="compile.classpath"/></javac></target><target name="copyProperites" depends="clean"><copy  todir="${class.dir}"><fileset dir="${src.dir}" excludes="**/*.java"/></copy></target><target name="deploy" depends="compile,copyProperites"><delete file="${dist.dir}/${webapp.name}.war"/><war destfile="${dist.dir}/${webapp.name}.war"><fileset dir="${webRoot.dir}"/></war></target></project>

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.