Book Review: Apache Maven 2 Effective Implementation

Apache Maven 2 Effective Implementation
Brett Porter and Maria Odea Ching
Packt Publishing
ISBN: 1847194540

My Rating: 7 out of 10

Apache Maven 2 Effective Implementation is an introduction to using Apache Maven 2 and, to a lesser extent, Apache Archiva and Apache Continuum. The book provides a basic introduction to using Apache Maven 2 as a build tool for application development. The audience of the book is Java developers with moderate to no experience with Maven 2.

Effective Implementation kicks off with a quick introduction to Maven basics by setting up a build for a simple web application (a Java EE WAR). This introduction is quite good and does provide the reader with enough information in a relatively small number of pages to be effective, without going overboard.

The second chapter jumps into installing and using Archiva with Maven. I found this chapter to be awkward and confusing. The chapter seems to be intended to introduce the general concept of Maven Repositories and Repository Managers, but seems to miss he mark. Most of the chapter is wasted on installing and setting up Archiva.

Chapters three through six make up for the slight stumble by providing a thorough and representative use of Maven in a more practical example application. Chapter three initiates a set of projects and works through the basics of building with Maven. Chapter four guides the reader through testing with Maven with the projects started in Chapter three. Chapter five works through the possibilities of documentation and reporting with Maven. The sixth chapter provides an overview of interesting Maven plugins that can be utilized to provide commonly requested features for builds, testing and reporting. For those without any Maven experience, these chapters provide a good overview of day-to-day Maven use and a number of tips and insights to make Maven more usable and productive.

Chapter seven, Maven Best Practices, is a mishmash of various tips and tricks that didn't fit into the narrative of the proceeding chapter. As a long-time Maven user, I found this chapter the most interesting, as there were a few hidden secrets that I learned about.

The remaining chapters are mostly focused on Archiva and Continuum. Though interesting and containing a few nuggets of value, they're mostly bogged down by more trivial content -- setting up this, tweaking that. This quickly gets tedious and tends to induce skimming, which means that some of the good bits are missed. I think some of the content in these chapters could have been pulled into the appendices, where could then referenced when actually needed. An external reference web site would also work well.

There are a few appendices, though I think the first two could have just been chapters themselves, especially the Troubleshooting Maven appendix. The Recent Maven Features probably could have been matched up with chapters three, four, five and six as an advanced features chapter. The third appendix Migrating Archiva and Continuum Data is a good example of an appendix and a template for factoring out the administrative content I mentioned previously.

Overall, Apache Maven 2 Effective Implementation is a good introduction to Maven and provides a great reference for getting new and recently new users of Maven. For those with some Maven experience already, there are still a few good bits of insight. For those interested in going beyond Maven and using Archiva and Continuum to take the next step in automation, there's definitely plenty of good content on getting all three to work together.

Disclosure: I am a member of the Apache Software Foundation, a committer and PMC member of the Apache Harmony project and I have contributed a few patches to the Apache Maven project.


Moving to Gemcutter - keeping it clean

It seems the transition from the RubyForge Gems server (http://gems.rubyforge.org/) to the Gemcutter Gems server (http://gemcutter.org/) is nearly complete. The address of the former is now a DNS alias of the later.

If you're like me, you like to keep up-to-date, tidy and clean. In this case that means keeping my RubyGem sources list clean. Here's the quick and simple steps I took on my RubyGem installs to get everything cleaned up.

  1. Add Gemcutter Server - $ sudo gem sources -a http://gemcutter.org/
  2. Remove RubyForge Server - $ sudo gem sources -r http://gems.rubyforge.org/
  3. Remove GitHub Server - $ sudo gem sources -r http://gems.github.com

Note - if you get any errors about the server not being present in the cache, this may be due to a minor difference in the URL used to add the server and the one being used to remove it. For example, a trailing slash. Run sudo gem sources to see all of the servers and the exact URL that's configured.


First Book Review

In the next week or so I'll be doing my first book review. I was sent a request last week by Packt to review the book Apache Maven 2 Effective Implementation. I'm looking forward to it, as I've been using Maven 2 for quite a while and I have plenty of opinions to share.

Full disclosure: I am a member of the Apache Software Foundation, a committer and PMC member of the Apache Harmony project and I have contributed a few patches to the Apache Maven project.


Adding the accept-charset attribute to HTML forms with Rails helpers

An oft unused attribute of the FORM element of HTML is the accept-charset. I'm a bit of a encoding fanatic and someone pointed out to me that I wasn't setting this attribute on a Rails application that I'd hacked up. As I'm always interested in learning something new about Rails, I decided to try setting this attribute in my application.

When using the base FormTagHelper#form_tag, it's pretty simple.

<% form_tag(search_solutions_path, {:'accept-charset' => "UTF-8"}) do -%>
<% end -%>

Note the use of the quotes around the symbol accept-charset. This is required because a hyphen requires escaping to be used in Ruby symbols.

When using the RESTful FormHelper#form_for, it's a bit more complicated and not very clearly documented. After some debugging and trial & error, I figured out that you have to add another level of indirection to add HTML options.

<% form_for(@model, {:html => {:'accept-charset' => "UTF-8"}}) do |f| %>
<% end -%>


Eight months

Time seems to be speeding up. It's now T+8 months since Maddie joined the Beyer fray. It's incredible to see how much she's changed and grown. She's sitting up. She's gabbing and talking. She's rolling, everywhere. When we put her in her rocketship-shaped walker, she runs around, chasing and hollering at the cats. Her latest noise and action is growling with a slight grimace. Needless to say it's very cute.



Well we've been parents for 11 days now. It's hard work, but Maddie is a very good baby and has even let us sleep for 4 hours at a time on a few occasions! She likes the 'open air pee', so we've amassed quite a bit of dirty laundry over the past few days. Maybe it is the smooth fuzzy changing table covers that make her relax...
Dad is a much better diaper changer than I am, but I've been getting in some good practice recently.
Several people have asked for some updated photos, so I'm going to attempt to post some on the gallery site.

Link to photos


Here's Maddie

Our little bundle finally arrived!

Madeline Elizabeth Beyer
2007-03-12 @ 0844
5lb 12oz

Check out the latest pictures on our gallery site.