Developing for the Web is bread and butter for Ant developers. There
is a wide spectrum of tasks at your disposal: Chapter 4 introduced packaging and
deploying applicationsincluding Web applicationsï£§with the
jspc, and for deploying them, such as
scp. I’ll cover the custom Ant tasks targeted to
specific servers such as
undeploy. And there’s more to come: Chapter 9 covers the many optional
Enterprise JavaBeans (EJB) tasks Ant supports.
war task is an
extension of the
jar task, and it
compresses Web applications into .war files, with
special handling for files that should end up in the
or WEB-INF directories on the server. For example,
say you have this directory layout after you build your project:
war |____output | login.class | logout.class | |____source | login.xml | |____html welcome.xml
The build file in Example 8-1 will create the .war file you need to deploy this application, placing the .class files in the WEB-INF/classes directory, renaming login.xml web.xml and placing it in WEB-INF, and so on.
<?xml version="1.0" encoding="UTF-8" ?> <project default="main" basedir="."> <property name="bin" value="output" /> <property ...