<?xml version="1.0" encoding="UTF-8"?>
<project name="WAS JSP PreCompile" default="jspc" basedir=".">
<property name="was.home" location="D:/IBM/WebSphere/AppServer"/>
<property name="webapp.path" location="D:/IBM/WebSphere/AppServer/installableApps/DefaultApplication/DefaultWebApplication"/>
<property name="jspc.path" location="${webapp.path}/jspc"/>
<!-- 是否保留生成的.java文件 -->
<property name="java.keep" value="true"/>
<!-- ;${was.home}/runtimes/com.ibm.ws.webservices.thinclient_6.1.0.jar -->
<property name="jsp.classpath" value="${was.home}/lib/bootstrap.jar;${was.home}/lib/startup.jar;${was.home}/lib/j2ee.jar"/>
<target name="make-dir">
<mkdir dir="${jspc.path}"/>
</target>
<!-- 定义 WAS JSP 预编译任务 -->
<taskdef name="wsjspc" classpath="${was.home}/plugins/com.ibm.ws.runtime_6.1.0.jar" classname="com.ibm.websphere.ant.tasks.JspC"/>
<!-- 调用 WAS JSP 预编译工具,进行对 JSP 进行编译 -->
<target name="jspc" depends="make-dir">
<wsjspc wasHome="${was.home}" src="${webapp.path}" toDir="${jspc.path}" forcecompilation="true" verbose="true" deprecation="false" loglevel="CONFIG" keepgenerated="${java.keep}" classpath="${jsp.classpath}"/>
</target>
<property name="ear.path" location="D:/IBM/WebSphere/AppServer/installableApps/DefaultApplication.ear"/>
<property name="extract.dir" location="${was.home}/temp/DefaultApplication.earextract"/>
<!-- 编译整个EAR -->
<target name="jspcEar">
<mkdir dir="${extract.dir}"/>
<wsjspc wasHome="${was.home}" earpath="${ear.path}" forcecompilation="true" extractToDir="${extract.dir}" useThreadTagPool="true" keepgenerated="${java.keep}" jspCompileClasspath="" classpath="${jsp.classpath}" loglevel="CONFIG"/>
</target>
</project>