References: https://supportweb.cs.bham.ac.uk/documentation/tutorials/docsystem/build/tutorials/ant/ant.html
Build.xml
<?xml version= "1.0" encoding= "UTF-8"?> <project "basedir=" "default=" main "name=" Yuxi HDFS "> <path id=" P Roject.classpath "> <pathelement location="/root/yuxihdfs/web-inf/lib/hadoop-core-1.0.0.jar "/> < Pathelement location= "/root/yuxihdfs/web-inf/lib/commons-logging-1.1.1.jar"/> </path> <!--<path id= "Svnant.classpath" > <pathelement location= "/usr/local/ant/lib/svnkit.jar"/> <pathelement location= " Usr/local/ant/lib/svnant.jar "/> <pathelement location=/usr/local/ant/lib/svnjavahl.jar"/> < Pathelement location= "/usr/local/ant/lib/svnclientadapter.jar"/> </path> <typedef resource= "Org/tigris /subversion/svnant/svnantlib.xml "classpathref=" Svnant.classpath "/>--> <typedef resource=" org/tigris/ Subversion/svnant/svnantlib.xml "classpath=" Svnant.jar "/> <svnsetting id=" svn.settings "false" javahl= = ' true ' username= ' user1 ' password= ' passwd '/> <target ' svn ' > <echo message= "checkout source code"/> <svn refid= "svn.settings" > <checkout url= "Svn://192.168.11.124/rep"
Os/yuxihdfs "destpath="/root/yuxihdfs "/> </svn> </target> <target name=" compile "depends=" SVN "> <mkdir dir= "/root/yuxihdfs/build"/> <javac debug= "true" debuglevel= "Source,lines,vars" destdir= "/root/" Yuxihdfs/build "source=" 1.6 "target=" 1.6 "includeantruntime=" on "> <classpath refid=" Project.classpath "/> &L
T;SRC path= "/root/yuxihdfs/src"/> </javac> </target> <target name= "compress" depends= "compile" > <mkdir dir= "/root/yuxihdfs/dist"/> <jar jarfile= "/root/yuxihdfs/dist/lib/yuxi_hdfs-1.0.0.jar"/ Root/yuxihdfs/build "> <include name=" com/yuxipacific/**/*.class "/> <manifest> <attribute name= "Yuxihdfs-version" value= "1.0"/> </manifest> </jar> <war destfile= "/ROOT/YUXIHDFS/DIST/YUXIHDFS.W Ar "webxml="/root/yuxihdfs/web-inf/web. xml "> <webinf dir="/root/yuxihdfs/web-inf/"includes=" Applicationcontext.xml "/>" <lib dir= "/root/YuxiHD" Fs/web-inf/lib "/> <lib dir="/root/yuxihdfs/dist/lib "/> </war> </target> <target name=" Deplo Y "depends=" compress "> <echo message=" "Stop Tomcat Server/> <exec" executable= own.sh "/> <delete dir=/usr/local/tomcat/webapps/yuxihdfs"/> <copy "file=" Yuxihdfs.war "todir="/usr/local/tomcat/webapps "/> <echo message=" start tomcat server "/> <exec executable= "/usr/local/tomcat/bin/startup.sh"/> </target> <target name= "main" depends= "deploy" > <delete dir= " /root/yuxihdfs "/> </target> </project>