< project name ="buildTest" basedir ="." default ="deply" > < property environment ="env" /> < property name ="src.dir" value ="${basedir}/src" /> < property name ="build.dir" value ="${basedir}/build" /> < property name ="dist.dir" value ="${basedir}/dist" /> < property name ="jboss.home" value ="${env.JBOSS_HOME}" /> < property name ="jboss.server.config" value ="default" /> <!-- Path Set --> < path id ="classpath" > < fileset dir ="${jboss.home}/client" > < include name ="**/*.jar" /> </ fileset > < pathelement location ="${build.dir}" /> < pathelement location ="${dist.dir}" /> </ path > < target name ="init" description ="init" > < delete dir ="${build.dir}" /> < delete dir ="${dist.dir}" /> < mkdir dir ="${build.dir}" /> < mkdir dir ="${dist.dir}" /> </ target > < target name ="complie" depends ="init" description ="complie" > < javac destdir ="${build.dir}" srcdir ="${src.dir}" includes ="**" > < classpath refid ="classpath" /> </ javac > </ target > < target name ="packageToJar" depends ="complie" description ="packageToJar" > < jar destfile ="${dist.dir}/${ant.project.name}.jar" basedir ="${build.dir}" includes ="**" /> </ target > < target name ="deply" depends ="packageToJar" description ="deploy To JBOSS_HOME" > < copy file ="${dist.dir}/${ant.project.name}.jar" todir ="${jboss.home}/server/${jboss.server.config}/deploy" /> </ target > < target name ="deldeply" description ="delete jar file" > < delete file ="${jboss.home}/server/${jboss.server.config}/deploy/${ant.project.name}.jar" /> </ target > </ project >