如果您使用码头发行版附带的JSP库,那将是最好的选择。
这是一个使用jetty-distribution-8.1.5.v20120716的示例
<?xml version="1.0" ?><project name="AntExample1" default="war"> <property name="jetty.home" value="${user.home}/pre/intalio/distros/jetty-distribution-8.1.5.v20120716" /> <path id="compile.jspc"> <fileset dir="${jetty.home}"> <include name="lib/servlet-api-*.jar" /> <include name="lib/jsp*.java" /> </copy> </target> <target name="compile" depends="init"> <javac destdir="build/classes" debug="true" srcdir="build/gen-src"> <classpath refid="compile.classpath" /> </javac> </target> <target name="war" depends="jspc"> <war destfile="dist/AntExample.war" webxml="WebContent/WEB-INF/web.xml"> <fileset dir="WebContent" /> <classes dir="build/classes" /> </war> </target> <target name="clean"> <delete dir="dist" /> <delete dir="build" /> </target></project>更新:2013年4月8日
将带有此构建的示例项目推送到github。
https://github.com/jetty-project/jetty-example-jspc-
ant



