I received Steve Loughran and Erik Hatcher’s Ant In Action to review well over a year ago and I actually thought I had posted a review for it before now. Digging through my site though it appears not. Which sucks, because this is a great book.

When I was reading Ant In Action originally I was working in a Java shop as the QA / Tester. (I have also been the build person at various times for different organizations.) One of the first things I tend to do on a project is extend the build system to include static checks to try and catch the low hanging fruit. On this particular project it meant wading into the quagmire that was their build system. Without a word of exaggeration, one task required ant to call perl which shelled out to call ant. After reading this book I could have easily wrestled the build into submission.

The structure of the book was well thought-out, which is not surprising as this is the renamed second edition of ‘Java Development with Ant’, with a consistent example that starts out with compiling a single class and ends up dealing with a number of the pains one experiences with large-scale enterprise projects. There are any number of pages on how to use Ant in its most basic guises, but it is these more advanced topics where the book shines.

  • Working with big projects – Build chaining is hard, and likely always will be. It does not however have to be messy and chaotic
  • Managing dependencies – A nice introduction to the Ivy dependency management system. I’m quite convinced that if you are not migrating from Ant to Maven you should be incorporating something like Ivy into your build system. This chapter explains to start managing your dependencies and even includes a section on publishing to a local repository which is important in a corporate context.
  • Working with XML – The build system I was working with had a large number of servers that could be deployed to. Each had its own set of XML files which differed by only a line or two. The Working with XML chapter would have cleaned this up a lot.

Those are of course in addition to the earlier chapters where you learn about datatypes, parameters, packaging, deployment and other day-to-day items. Also, it is definitely worth mentioning that the first topic really explored in depth is integration of JUnit into your build (Chapter 4) which absolutely appeals to the tester part of me.

Because I can’t just be happy with a well-written book that taught me a lot, here is what I would change for the 3rd edition if they produce one.

  • Include blank pages at the back of the book for note taking
  • While it is great the integration of static analysis tool Checkstyle is shown, including FingBugs or PMD would have rounded out the section by including dynamic analysis as well
  • Use the CruiseControl as the server in Continuous Integration chapter. They explain why they did not, but that is the server most people reading this will be using.

Overall, this is a fantastic book that should be on the shelves of any Java shop still using Ant and should be mandatory reading for anyone whose job involves modifying Ant’s build files.

Now all I need is Ant In Action-esque book for Rake.