<path id="classpath"> 构建文件最经典的classpath,其中id为类路径的名称 <fileset dir="${web.dir}/WEB-INF/lib"> <include name="*.jar"/> </fileset> 向classpath中加入Web应用程序下的类库 <fileset dir="${tomcat.home}/common/lib"> <include name="servlet*.jar"/> </fileset> 向classpath中加入tomcat服务器的类库 <pathelement path="${build.dir}"/> pathelement是用来加入单一的路径,例子中加入build.dir全个目录。全个类路径任务的代码如下: <path id="classpath"> <fileset dir="${web.dir}/WEB-INF/lib"> <include name="*.jar"/> </fileset> <fileset dir="${tomcat.home}/common/lib"> <include name="servlet*.jar"/> </fileset> <pathelement path="${build.dir}"/> </path> 转载于:https://www.cnblogs.com/fjchenq/archive/2007/05/28/762628.html