Example of the Ant war task (sample Ant build script)

Ant war task example: Here's another snippet of code from my most recent Ant build scripts. This example code shows how I use the Ant war task to create my war file:

<!-- with all resources in place, create the war file -->
<war destfile="${package.file}" 
  <fileset dir="${pages.dir}"/>
  <lib dir="${lib.dir}" />
  <classes dir="${temp.dir.classes}" />

As with my other examples, I know that I've mixed some variables in here, but I'm hoping the names will be meaningful enough that you'll be able to use this sample code in your own build scripts and Java projects. If it helps to know it, this sample code comes from a working, "real world" project.

Add new comment

Anonymous format

  • Allowed HTML tags: <em> <strong> <cite> <code> <ul type> <ol start type> <li> <pre>
  • Lines and paragraphs break automatically.