Skip to Main Content
Jakarta Struts Cookbook
book

Jakarta Struts Cookbook

by Bill Siggelkow
February 2005
Intermediate to advanced content levelIntermediate to advanced
528 pages
12h 53m
English
O'Reilly Media, Inc.
Content preview from Jakarta Struts Cookbook

1.7. Using Ant to Build and Deploy

Problem

You want to be able to build and deploy your Struts web application in a repeatable and portable manner.

Solution

Create an Ant (http://ant.apache.org) build script and use Ant (or your IDE's Ant integration) to compile, test, package, and deploy your application. Example 1-8 is a boilerplate Ant build file that can compile, build, and deploy a Struts application.

Example 1-8. Boilerplate Ant build file

<project name="jsc-ch01-r02" default="dist" basedir="."> <description> Jakarta Struts Cookbook - Ant Template </description> <!-- Enable access to environment variables --> <property environment="env"/> <!-- Set to use JDK 1.4 --> <property name="build.compiler" value="javac1.4"/> <!-- set global properties for this build --> <property name="src.dir" location="src"/> <property name="build.dir" location="build"/> <property name="dist.dir" location="dist"/> <property name="server.dir" location="${env.CATALINA_HOME}"/> <property name="servlet.jar" location="${server.dir}/common/lib/servlet-api.jar"/> <property name="jsp.jar" location="${server.dir}/common/lib/jsp-api.jar"/> <property name="struts.dist.dir" location="c:/jakarta-struts-1.1/lib"/> <!-- Struts --> <fileset id="struts.lib.files" dir="${struts.dist.dir}"> <include name="**/*.jar"/> </fileset> <path id="struts.classpath"> <fileset refid="struts.lib.files"/> </path> <path id="project.class.path"> <pathelement location="${servlet.jar}"/> <pathelement location="${jsp.jar}"/> <path refid="struts.classpath"/> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Programming Jakarta Struts

Programming Jakarta Struts

Chuck Cavaness
Beginning Spring Framework 2

Beginning Spring Framework 2

Bruce Snyder, Sing Li, Anne Horton, Thomas Van de Velde, Naveen Balani, Christian Dupuis
Java Cookbook

Java Cookbook

Ian F. Darwin
Struts 2 in Action

Struts 2 in Action

J. Scott Stanlick, Chad Michael Davis, Donald J. Brown

Publisher Resources

ISBN: 059600771XSupplemental ContentErrata Page