Foreword to the First Edition

Ant started its life on a plane ride, as a quick little hack. Its inventor was Apache member James Duncan Davidson. It joined Apache as a minor adjunct—almost an afterthought, really—to the codebase contributed by Sun that later became the foundation of the Tomcat 3.0 series. The reason it was invented was simple: it was needed to build Tomcat.

Despite these rather inauspicious beginnings, Ant found a good home in Apache, and in a few short years it has become the de facto standard not only for open source Java projects, but also as part of a large number of commercial products. It even has a thriving clone targeting .NET.

In my mind four factors are key to Ant’s success: its extensible architecture, performance, community, and backward compatibility.

The first two—extensibility and performance—derive directly from James’s original efforts. The dynamic XML binding approach described in this book was controversial at the time, but as Stefano Mazzocchi later said, it has proven to be a “viral design pattern”: Ant’s XML binding made it very simple to define new tasks and, therefore, many tasks were written. I played a minor role in this as I (along with Costin Manolache) introduced the notion of nested elements discussed in section 17.6. As each task ran in the same JVM and allowed batch requests, tasks that often took several minutes using Make could complete in seconds using Ant.

Ant’s biggest strength is its active development community, originally fostered by Stefano and myself. Stefano acted as a Johnny Appleseed, creating build.xml files for numerous Apache projects. Many projects, both Apache and non-Apache, base their Ant build definitions on this early work. My own focus was on applying fixes from any source I could find, and recruiting new developers. Nearly three dozen developers have become Ant “committers,” with just over a dozen being active at any point in time. Two are the authors of this book.

Much of the early work was experimental, and the rate of change initially affected the user community. Efforts like Gump sprang up to track the changes and have resulted in a project that now has quite stable interfaces.

The combination of these four factors has made Ant the success that it is today. Most people have learned Ant by reading build definitions that had evolved over time and were largely developed when Ant’s functionality and set of tasks were not as rich as they are today. You have the opportunity to learn Ant from two of the people who know it best and who teach it the way it should be taught—by starting with a simple build definition and then showing you how to add in just those functions that are required by your project.

You should find much to like in Ant. And if you find things that you feel need improving, then I encourage you to join Erik, Steve, and the rest of us and get involved!

SAM RUBY

Director, Apache Software Foundation

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset