ant compile任务(javac)
<target name="compile" description="Compile main source tree java files">
<!--compile source code-->
<mkdir dir="${build.dir}/classes"/>
<javac destdir="${build.dir}/classes" target="1.4" debug="true"
deprecation="false" optimize="false" failonerror="true">
<src path="${src.dir}"/>
<classpath refid="classpath"/>
</javac>
<!-- compile tests -->
<mkdir dir="${test.dir}/classes"/>
<javac destdir="${test.dir}/classes" target="1.4" debug="true"
deprecation="false" optimize="false" failonerror="true">
<src path="${test.src}"/>
<classpath>
<path refid="classpath"/>
<path location="${build.dir}/classes"/>
</classpath>
</javac>
<!-- Copy hibernate mapping files to ${build.dir}/classes -->
<copy todir="${build.dir}/classes">
<fileset dir="${src.dir}" includes="**/*.hbm.xml"/>
</copy>
</target>
<!--compile source code-->
<mkdir dir="${build.dir}/classes"/>
<javac destdir="${build.dir}/classes" target="1.4" debug="true"
deprecation="false" optimize="false" failonerror="true">
<src path="${src.dir}"/>
<classpath refid="classpath"/>
</javac>
<!-- compile tests -->
<mkdir dir="${test.dir}/classes"/>
<javac destdir="${test.dir}/classes" target="1.4" debug="true"
deprecation="false" optimize="false" failonerror="true">
<src path="${test.src}"/>
<classpath>
<path refid="classpath"/>
<path location="${build.dir}/classes"/>
</classpath>
</javac>
<!-- Copy hibernate mapping files to ${build.dir}/classes -->
<copy todir="${build.dir}/classes">
<fileset dir="${src.dir}" includes="**/*.hbm.xml"/>
</copy>
</target>