Chapter 17. Ant

Enterprise software development involves a (sometimes complex) combination of source code, configuration files, HTML pages, images, and various other assets that need to be processed, combined, and deployed in order to create a running application. In addition to compiling and running code, a number of other tasks need to be performed to manage an enterprise project: generating documentation, running tests against code, interacting with source control systems, and more.

Over the years, several tools have emerged to help manage the various repetitive tasks involved with developing software. Earlier examples include make and gnumake, command-line tools that have been used to manage building and packaging code, primarily on Unix systems. make and its variants utilize a text-based command file, a makefile, that you use to specify how various tasks (compiling code, generating executables, etc.) are to be carried out, as well as dependencies between various tasks (e.g., an executable should be generated only if all of the compiled code is up-to-date).

In Java development projects, Ant has emerged as the de facto tool of choice for these types of tasks. Integrated development environments (IDEs) typically provide build/deploy tools, but Ant supports these and other development tasks in an independent manner, separate from any specific IDE. This, along with the nearly ubiquitous support in Java IDEs for editing and exercising Ant buildfiles, has made Ant a very popular tool ...

Get Java Enterprise in a Nutshell, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.