![]() |
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- ********************************************************************* -->
<!-- Ant build script for JSP Precompilation in Tomcat -->
<!-- Version: $Id: jsp-precompile.xml,v 1.00 2008/02/28 18:40:00 andowson Exp $ -->
<!-- ********************************************************************* -->
<project name="Webapp Precompilation" default="all" basedir=".">
<target name="jspc">
<taskdef classname="org.apache.jasper.JspC" name="jasper2" >
<classpath id="jspc.classpath">
<pathelement location="${java.home}/../lib/tools.jar"/>
<fileset dir="${tomcat.home}/bin">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/server/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<jasper2
validateXml="false"
uriroot="${webapp.path}"
webXmlFragment="${webapp.path}/WEB-INF/generated_web.xml"
outputDir="${webapp.path}/WEB-INF/src"
addWebXmlMappings="true" />
</target>
<target name="compile">
<mkdir dir="${webapp.path}/WEB-INF/classes"/>
<mkdir dir="${webapp.path}/WEB-INF/lib"/>
<javac destdir="${webapp.path}/WEB-INF/classes"
optimize="off"
debug="on" failonerror="false"
srcdir="${webapp.path}/WEB-INF/src"
excludes="**/*.smap">
<classpath>
<pathelement location="${webapp.path}/WEB-INF/classes"/>
<fileset dir="${webapp.path}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${tomcat.home}/common/classes"/>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${tomcat.home}/shared/classes"/>
<fileset dir="${tomcat.home}/shared/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/bin">
<include name="*.jar"/>
</fileset>
</classpath>
<include name="**" />
<exclude name="tags/**" />
</javac>
</target>
<target name="all" depends="jspc,compile">
</target>
<target name="cleanup">
<delete>
<fileset dir="${webapp.path}/WEB-INF/src"/>
<fileset dir="${webapp.path}/WEB-INF/classes/org/apache/jsp"/>
</delete>
</target>
</project>
ant -Dtomcat.home=/var/tomcat5 -Dwebapp.path=/home/andowson/www/examples -buildfile jsp-precompile.xml
檔案名稱 | jsp-precompile.xml |
描述 | Tomcat JSP precompile Ant Task |
檔案大小 | 2 Kbytes |
下載次數 | 17 次 |
![]() |
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- ********************************************************************* -->
<!-- Ant build script for JSP Precompilation in Tomcat -->
<!-- Version: $Id: precompile.xml,v 1.00 2008/02/28 18:40:00 andowson Exp $ -->
<!-- ********************************************************************* -->
<project name="Webapp Precompilation" default="all" basedir=".">
<property name="tomcat.home" location="${tomcat.home}"/>
<property name="tomcat.base" location="${tomcat.base}"/>
<property name="webapp.hostname" value="${webapp.hostname}" />
<property name="webapp.name" value="${webapp.name}" />
<property name="webapp.path" location="${tomcat.base}/webapps/${webapp.hostname}/${webapp.name}"/>
<property name="dir-path" location="${tomcat.base}/work/Catalina/${webapp.hostname}/${webapp.name}"/>
<target name="jspc">
<taskdef classname="org.apache.jasper.JspC" name="jasper2" >
<classpath id="jspc.classpath">
<pathelement location="${java.home}/../lib/tools.jar"/>
<fileset dir="${tomcat.home}/server/lib">
<include name="*.jar"/>
</fileset>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<jasper2
validateXml="false"
uriroot="${webapp.path}"
webXmlFragment="${webapp.path}/WEB-INF/generated_web.xml"
outputDir="${webapp.path}/WEB-INF/src" />
<move todir="${dir-path}">
<fileset dir="${webapp.path}/WEB-INF/src">
<include name="**/*.*"/>
</fileset>
</move>
<delete dir="${webapp.path}/WEB-INF/src" failonerror="false"/>
</target>
<target name="compile">
<echo>Compile JSP in: ${dir-path}</echo>
<javac destdir="${dir-path}"
optimize="off"
debug="on"
failonerror="false"
srcdir="${dir-path}">
<classpath>
<pathelement location="${webapp.path}/WEB-INF/classes"/>
<fileset dir="${webapp.path}/WEB-INF/lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${tomcat.home}/common/classes"/>
<fileset dir="${tomcat.home}/common/lib">
<include name="*.jar"/>
</fileset>
<pathelement location="${tomcat.home}/shared/classes"/>
<fileset dir="${tomcat.home}/shared/lib">
<include name="*.jar"/>
</fileset>
</classpath>
<include name="**/*.java" />
</javac>
</target>
<target name="all" depends="jspc,compile">
</target>
</project>
ant -Dtomcat.home=/var/tomcat5 -Dtomcat.base=/var/robust/worker1 -Dwebapp.hostname=www.andowson.com -Dwebapp.name=examples -buildfile precompile.xml
檔案名稱 | precompile.xml |
描述 | Tomcat JSP precompile Ant Task |
檔案大小 | 3 Kbytes |
下載次數 | 19 次 |
![]() |