Skip to Content
Jakarta Struts Cookbook
book

Jakarta Struts Cookbook

by Bill Siggelkow
February 2005
Intermediate 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.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Jakarta Commons Cookbook

Jakarta Commons Cookbook

Timothy M. O'Brien
Beginning Spring Framework 2

Beginning Spring Framework 2

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

Publisher Resources

ISBN: 059600771XErrata Page