This Ant script precompiles deployed .jsp files in Tomcat using AspectJ 1.1.

Usage:

{ant} -f {this-script} \ -Dtomcat.home=/home/tomcat \ -Dwebapp.name=launchWeb \ -DASPECTJ_HOME=/dev/tools/aspectj-1.1.0

This defines the web application deployment $${webapp.dir} as

$${tomcat.home}/webapps/$${webapp.name}

, generates the Java source files to

$${webapp.dir}/WEB-INF/src

, uses iajc (AspectJ) to compile them to

$${webapp.dir}/WEB-INF/classes,

, and creates the mappings

$${webapp.dir}/WEB-INF/generated_web.xml,

which must be manually inserted into

$${webapp.dir}/WEB-INF/generated_web.xml,

at which point the web application can be reloaded.

This assumes that aspectjrt.jar is already deployed in any of places on the Tomcat application classpath (the application, shared, or common classpath). If ASPECTJ_HOME is not defined, it assumes that aspectjtools.jar is in

${CATALINA_HOME}/common/lib