Preface to the Second Edition

Gosh, is it time for a new edition already? That’s one of the odd aspects of writing about open source projects: the rapid release cycles and open development process mean that things date fast—and visibly. In a closed source project, changes are invisible until the next release ships; in open source, there’s a gradual divergence between the code at the head of the repository and that covered in a book.

Java Development with Ant shipped in 2002, at the same time as Ant 1.5. Both the build tool and the book were very successful. Ant became the main way people built and tested Java projects, and our book showed how to use Ant in big projects and how to solve specific problems.

Ant 1.6 came along, and people started asking how some of the scalability improvements changed the build, and we would say “it makes it easier” without having any specifics to point to. At the same time, other interesting technologies came along to help, such as Ivy for dependency management, and other tools for deployment and testing. Java development processes had improved—and it was time to document the changes.

So I did. Erik, having just finished Lucene in Action, took a break from the Ant book series, leaving me the sole author of the second edition. I was blessed with a good start: all the text from the first edition. This text was a starting place for what turned out to be a major rewrite. Along with the changes to Ant, I had to deal with the changes in Enterprise Java, in XML schema languages, as well as in deployment and testing tools and methodologies. This made for some hard choices: whether to stay with JUnit and Java EE or whether to switch to Spring, OSGi, and TestNG as the way to package, deliver, and test applications. I chose to stay with the conventional ecosystem, because people working in Java EE need as much help as they can get, and because the tooling around JUnit 3 is excellent. If and when we do a third edition, things may well change yet again.

This book is now completely updated to show how to build, test, and deploy modern Java applications using Ant 1.7. I’m excited by some of the advanced chapters, especially chapters 10 and 11, which show Ant and Ivy working together to build big projects, managing library dependencies in the process. Chapter 16, deployment, is a favorite of mine, because deployment is where I’m doing my research. If you can automate deployment to a three-tier machine, you can automate that deployment to a pay-as-you-go infrastructure, such as Amazon’s EC2 server farm. If your application is designed right, you could even roll out the application to a grid of 500 servers hosting the application on their spare CPU cycles!

That’s why building and testing Java applications is so exciting. It may seem like housekeeping, something that an IDE can handle for you, but the projects that are the most interesting and fun, are the ones where you attempt to do things that nobody has done before. If you are going to be innovative, if you want to be leading edge, you will need tools that deliver both power and flexibility. Ant does both and is perfect for developing big Java applications.

But enough evangelization. I’ve enjoyed writing this book, and hope you will enjoy reading it!

STEVE LOUGHRAN

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

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