Appendix B. Apache Ant

Ant is the de facto standard for creating cross-platform build scripts for Java applications. An important feature that led to its popularity is the capability it offers developers to extend it via custom tasks. In Chapter 8, you learned how Tomcat's custom Ant tasks can be used to deploy and undeploy Web applications without the need to restart Tomcat. This means that not only can you build your application using an Ant build script, but you can also go a step further by installing, removing, reloading, or monitoring the Web application from the same build script. You can do a lot more with Ant, as this appendix illustrates.

This appendix provides a comprehensive overview of Ant features and capabilities. It covers the following:

  • A short, tutorial-style introduction to Ant.

  • Solutions ("recipes") for common tasks that system administrators need to do while developing build and deploy systems. Some of these tasks include:

    • A basic build script for a Web application

    • Making this build script reusable for different environments using property files and command-line parameters

    • Sending notifications of successful (or failed) builds to developers via e-mail

    • Ant and source code control systems

    • Further references for setting up a continuous integration environment

  • A reference for common Ant tasks.

Installing Ant

Ant started off as a subproject under the Jakarta project. Since then, its increasing popularity earned it a promotion — it's now a top-level project under Apache, and ...

Get Professional Apache Tomcat 6 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.