Saturday, April 21, 2012

Book Review: Apache Maven 3 Cookbook




Are you a long-time Ant fan being drawn into the world of Maven?  I am.  I like Ant and it's straight-line, totally transparent nature.  But I'm also pragmatic, and I think I can see the tide has turned.  Maven is now being used (almost required!) by a good many projects that I use daily.  It's high time I got on board.  So I picked up a copy of "Apache Maven 3 Cookbook" and started reading.

Like all Packt Cookbooks, this book follows a predictable format.  These books are meant to guide the reader directly through commonly encountered tasks.  You find an article title (i.e. "Integrating Scala development with Maven"), and under this heading you'll find a little text then the sections "Getting Ready", "How to Do It", and "How It Works".  There isn't  a lot of text spent explaining theory or history, it's mostly just how to accomplish a particular task.

The book starts out with the basics of Maven, which was useful for me.  Some of what I found in the first chapter I knew from previous dealings with Maven, some I thought I knew but wasn't sure, and some I hadn't seen before.  There are totally simple examples of how to set up Maven on various platforms.

The next few chapters cover the core of Maven's use cases.  Software engineering (complete with automated unit tests, code coverage reports, etc.) are explained here, as are the uses of Maven's dependency management system.  For those who are totally new to Maven, dependency management-- the automatic downloading and inclusion of libraries your project needs-- is probably the single best feature of Maven.

Hudson integration and various reports that can be generated are next.  The reports include JavaDocs, code coverage, and code quality, among others.

Some common Java development scenarios are covered next.  These include web applications, JEE apps, Spring, Hibernate and Seam.  Mostly what you are shown is use of an optimal archetype for each of these, then the expected directory structure after the project is generated.  There's also a little useful text about how to go about developing further in the chosen application type after that.

Chapter 6 is devoted to Google development with Maven.  Topics include Android development, GWT, and Google App Engine.

Chapter 7 explains Maven usage with Scala, Groovy, and Flex.

Chapter 8 explains using Maven with an IDE.  Eclipse, Netbeans, and IntelliJ are explained.

Finally, you are told how to extend Maven by making and documenting your own Maven plugins.

So, what's the final verdict?  This book was useful for me, as it explained many things about Maven I didn't previously know.  The book is formatted in such a way that it's task oriented, so it's a more comfortable read if you're coding as you're reading.  If you develop in some of the many use cases described above, you'll find some value in this book.

The book can be found here.

Happy assisted Software Engineering!