Listing B: Medium.xml
 
<project name="HelloWorld" default="dist" basedir=".">
  <!-- set global properties for this build -->
  <property name="src" value="src"/>
  <property name="build" value="build"/>
  <property name="dist"  value="dist"/>

  <target name="init">
    <!-- Create the time stamp -->
    <tstamp/>
    <!-- Create the build directory structure used by compile -->
    <mkdir dir="${build}"/>
  </target>

  <target name="compile" depends="init">
    <!-- Compile the java code from ${src} into ${build} -->
    <javac srcdir="${src}" destdir="${build}"/>
  </target>
  <target name="package" depends="compile">
    <!-- Create the distribution directory -->
    <mkdir dir="${dist}/lib"/>
    <jar jarfile="${dist}/lib/HelloWorld-${DSTAMP}.jar" basedir="${build}" manifest="manifest"/>
  </target>  <target name="dist" depends="package">
    <echo>
        Copying jar file to jnlp distribution.
    </echo>
    <copy file="${dist}/lib/HelloWorld-${DSTAMP}.jar" tofile="web/lib/HelloWorld-dist.jar"/>
  </target>
  <target name="clean">
    <!-- Delete the ${build} and ${dist} directory trees -->
    <delete dir="${build}"/>
    <delete dir="${dist}"/>
  </target>
</project>