Better Builds with Maven: How-to Guide for Maven 2.0

Vincent Massol, Jason van Zyl (2006)
Review date: April, 2008
Summary

Better Builds with Maven gives Maven newbies a solid foundation. The first chapter explains four governing principles:

  1. Convention over configuration: a standard directory layout, one output, and standard naming conventions
  2. Reuse of build logic: reusable plugins are executed with a well-defined build cycle
  3. Declarative Execution: a Project Object Model (POM) governs the builds
  4. Coherent Organization of Dependencies

The second chapter is a quick hands-on exercise in setting up a basic project. At the end of this chapter you feel quite confident with setting up simple Maven builds. In the third chapter a more complex application is glued together and more functionality is explained. The next chapter deals with packaging the various components of a J2EE application. Integration with JBoss, Tomcat, and Jetty is explained. This chapter is sort of a wrap up before entering the second part.

What follows now is a section on plugin development. After the plugin chapters come two similar chapters on creating various reports, of some which are more usable than others, and continuous integration. It's shown how Maven cooperates with utilities like PMD, Checkstyle, and Cobertura. The grand finale consists of a demonstration of how to migrate an existing build of Spring to Maven.

Opinion

One day Maven was dropped on me. Out team was supposed to use it. End of discussion. Having worked with Ant for a couple of years I thought: "Let's google this thing and get started". Today I can't say whether it was bad luck, bad googling or bad karma. I couldn't find anything usable on Maven 2. Period.

At that time I silently accepted the fact, and prayed for the thing to work, and lamented when it didn't. Boy did I need this book then... Anyway, without being sentimental, I can say that the first part of this book does a splendid job explaining what Maven is and the concepts behind it. Users of Ant will want to draw parallels to Maven, and this book will end all such attempts, as it explains that Maven really is an entire framework for managing a software project life-cycle.

To benefit most from this book, I suggest to stop reading it after 120 pages. After that you'll know how to work with Maven, and feel comfortable with it, without dwelling into the details of plugin development. To be honest, I didn't read that part very thoroughly, as as neither have the time nor the need to write my own plugins. Nevertheless, I bet that this section provides better structured information about the topic that random online tutorials. In summary, I really recommend this book to everybody who wants to learn Maven. The best thing about this book though, is that it's available on line for free!

Who should read this book

People new to Maven. Architects who want to familiarize themselves with Maven's principles, technical project managers who want smoother builds, and most of all developers, who will work with this thing. Chapter 6 may provide inspiration for teams that have good build routines and discipline and have the ambition to become better.




News

  • 2015-09-29

    It's been almost one and a half year since I reviwed a book! I've been too absorbed by Writing my own. Anyway, I'm back with Jeff Patton's relatively...
  • 2014-01-04

    New category! Performance! Reviewed The Every Computer Performance Book. Check it out!
  • 2013-09-10

    Reviewed a book that' slightly less technical, but much more fun to read. It's I.T. Confidential.
  • 2013-08-13

    Reviewed yet another book on Visual Studio 2012 and TFS. I also created a "Microsoft" category and moved the other TFS book there from the "Tools"...
  • 2013-08-05

    Updated the FAQ. Included information about getting a book reviewed.