Tag Archives: book

Apache Maven 2: Effective Implementation Sample Chapter

When I announced the release of the book last week, I neglected to mention that there is a sample chapter online. It is available from the book’s site, but can be directly downloaded as a PDF:

There is also an excerpt online if you don’t like PDF.

While it does stand alone, the examples are also worked in to the context of the sample project used throughout the book where appropriate.

This chapter was a late inclusion, but turned out to be one of my favourites. While it doesn’t cover all the useful Maven plugins (many such as the Enforcer and Assembly plugins are picked up elsewhere in the book), it highlights some that aren’t always well known or used:

  • The Remote Resources plugin – and particularly the right pattern for including a package of reusable resources
  • The Build Number plugin
  • The Shade plugin – a very useful way to handle redistributing JARs and “uberJARs” and reducing dependency and classloading issues
  • The Build Helper plugin – useful bits and pieces like additional artifacts to deploy and reserved network ports for tests
  • The AntRun plugin (and other scripting languages) – how to still use Ant without the guilt of violating The Maven Way!
  • The Exec plugin – fork an external process in your build, or configure it for running your standalone application easily from the POM

I do think if there was one plugin I would have liked to cover more in this centralised location it would have been the Enforcer – perhaps pulling some entries together would make a good blog topic in the future though.

I hope you enjoy the sample chapter and consider buying the book!


Book Released – Apache Maven 2: Effective Implementation

After being available in “RAW” (draft) form for the last few months, the final release of Apache Maven 2: Effective Implementation is now available online! It is available in both eBook and printed + eBook versions.

We had some specific goals in writing this that I think we’ve achieved:

  • It is intended to build on top of knowledge from the free books that have gone before it with minimal duplication – though still enough information to stand alone.
  • The book should be of most value to intermediate Maven users, but also useful to beginners. Everyone should learn something from it. It should update Maven 2.0 users on the latest available technology such as Maven 2.2, the newer Archetype creation from a project mechanism, and under-utilised plugins like the Enforcer or Shade plugins.
  • We wanted to focus on “best practices” and tying everything together in a way that shows how Maven was meant to be used. Hopefully readers will experience the occasional “aha!” moment.
  • The book works through the issues by a gradual example application, like building up (or applying Maven to) your own project. It intends to show how a reasonably complete project structure is best worked with, and the example application should be relatively interesting in its own right. It gets built from scratch, up to an assembly, building it in CI, deploying it to the repository, and releasing it.
  • We wanted to give some coverage to Archiva and Continuum (projects that we’ve both been involved in for some time) to illustrate team concepts, but also convey the concepts in a way that translates to other equivalent tools.

You can see what was covered in the Table of Contents.

The book eventually weighed in at 450 pages – far more than we’d intended when we set out, though still with plenty of potential topics to cover. When we started this just over a year ago, my thoughts had initially been around simply covering the content from my series of Maven presentations and training content in book form, but soon found we could expand on many of the topics.

I had the good fortune to work with Deng Ching on the book (her announcement is on her blog), who poured a number of weekends and evenings into writing half of the content and reading (and re-reading) my writing.

We had some great help from our reviewers – Carsten Ziegler, Wendy Smoak and Emmanuel Venisse, as well as the encouragement of several others who wanted to help but couldn’t commit the time. Thank you all!