<project name="beers" default="war" basedir="."> <property name="src" location="src/main/java"/> <property name="test.src" location="src/test/java"/> <property name="classes" location="build/classes"/> <property name="tests" location="build/tests"/> <property name="jetty" location="../jetty-6.1.25/lib"/> <property name="warfile" value="beers.war"/> <property name="server.webapps.dir" location="..\jetty-6.1.25\webapps"/> <path id="classpath"> <pathelement location="${classes}"/> <fileset dir="${jetty}" includes="**/*.jar"/> </path> <path id="test.classpath"> <pathelement path="${classpath}"/> <pathelement location="lib/junit/junit-4.8.2.jar"/> <pathelement path="${tests}"/> </path> <target name="clean"> <delete dir="build"/> </target> <target name="init" depends="clean"> <mkdir dir="${classes}"/> <mkdir dir="${tests}"/> </target> <target name="compile" depends="init"> <javac srcdir="${src}" destdir="${classes}" classpathref="classpath"/> <javac srcdir="${test.src}" destdir="${tests}" classpathref="test.classpath"/> </target> <target name="war" depends="compile"> <war destfile="${warfile}" webxml="src/metadata/web.xml"> <fileset dir="src/jsp"/> <lib dir="lib"/> <classes dir="build/classes"/> </war> <copy file="${warfile}" todir="${server.webapps.dir}"/> </target> </project>
Jetty is started by the command:
C:\path-to-jetty\jetty-6.1.25>java -jar start.jar