=======================================build.xml==============================================
<?xml version="1.0" encoding="UTF-8"?>
<project name="DBBaseDAO" default="makeproject" basedir=".">
<!--*********************************************************************
*********** definition *******************************************
**********************************************************************-->
<property file="build.properties" />
<property name="src.dir" value="${basedir}/src"/>
<property name="config.dir" value="${basedir}/config"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="classes.dir" value="${basedir}/class"/>
<property name="copyoverwrite" value="true"/>
<property name="JarDestPath" value="${JarDestPath}/"/>
<property name="ConfigDestPath" value="${ConfigDestPath}"/>
<property name="JarName" value="${JarName}"/>
<path id="base.classpath">
<fileset dir="${lib.dir}">
<include name="**/*.jar" />
</fileset>
</path>
<!--*********************************************************************
*********** initial *******************************************
**********************************************************************-->
<target name="makedir" depends="clean">
<mkdir dir="${classes.dir}" />
</target>
<!--*********************************************************************
*********** javac *******************************************
**********************************************************************-->
<target name="makeclass" depends="makedir">
<javac srcdir="${src.dir}" destdir="${classes.dir}">
<classpath refid="base.classpath"/>
</javac>
</target>
<!--*********************************************************************
*********** jar *******************************************
**********************************************************************-->
<target name="makejar" depends="makeclass">
<jar jarfile="${JarName}" >
<fileset dir="${classes.dir}">
<include name="**/*.class" />
</fileset>
</jar>
</target>
<!--*********************************************************************
*********** copy *******************************************
**********************************************************************-->
<target name="copyjar" depends="makejar">
<copy todir="${JarDestPath}" overwrite="${copyoverwrite}">
<fileset dir=".">
<include name="*.jar" />
</fileset>
<fileset dir="${lib.dir}">
<include name="*.jar" />
</fileset>
</copy>
</target>
<target name="copyConfig">
<copy todir="${ConfigDestPath}" overwrite="${copyoverwrite}">
<fileset dir="${config.dir}">
<include name="*.*" />
</fileset>
</copy>
</target>
<!--*********************************************************************
*********** Target: makeproject*****************************************
**********************************************************************-->
<target name="makeproject">
<ant target="copyjar" />
<ant target="copyConfig" />
<ant target="clean"/>
</target>
<!--*********************************************************************
*********** clean *******************************************
**********************************************************************-->
<target name="clean">
<delete dir="${classes.dir}"/>
<delete file="${basedir}/${JarName}"/>
</target>
</project>
=======================build.properties====================================================
JarDestPath=E:/workspace/lib
ConfigDestPath=E:/workspace/config
JarName=DBBaseDao1.0.jar