Monday, January 08, 2007

Half a Year of Maven 2: An experience of the awkward kind

We're using Maven 2 now for all new projects. At the highest level I can summarize our experience as:
  1. The concepts behind Maven are sound and amazingly useful.
  2. The implementation is just about usable - no show-stoppers anymore, but lots and lots of little, annoying bugs and surprising gotchas
  3. The documentation is sloppy.
The really funny thing is, how point 1. still by far outweighs the shortcomings 2. and 3 when it comes to the question "Was it worth it, after all?".

So what made it useful, after all?
  • First of all, it gives your builds a uniformity and completeness (JavaDocs, HiveDocs, PMD, CPD, ...) that would be difficult to achieve otherwise without having a dedicated, organization-wide build-manager (as a real person:).
  • Secondly, it facilitates re-use by making doing the right things easier than the wrong ones. Having cleanly specified dependencies referring to specific binary versions of jars makes a bigger difference than you might think without trying. And being able to inherit a big part of your build-setup from an org-wide POM (the ant project descriptor) is a real killer feature. Together with archetypes this makes the overhead for starting a new library-module really negligable.
Enough praise. The downside is, there is still way enough room for maven-improvement wishes for the new year. Too many things just make - sorry - too sloppy an impression for a project which is purportedly backed by a professional org (Mergere). Some of the issues I remember are:
  • Docs: One of the benefits of Maven should be good consistent docs. Ever searched for reference docs on the site-descriptor site.xml? Google the mailing-lists. Wondering how to generate standard plugin-documentation? Don't bother with the docs. Just have a look at the POM's of existing modules. Looking for core API-docs? You'll find something like this
  • The SCM / release plugin claims to support DOS'ish CVS-pathes (D:\...) - in the report it works, but the release:prepare fails.
  • Special characters in the generated docs don't work. E.g. german locale.
  • Want to create a repo-bundle for a multi-module project? Doesn't work.
  • In a Mojo you can inject things into private fields - If a superclass happens to have a private field of the same name the injection fails silently.
So, after all, a great tool with a great amount of small issues to work on. Please, Maven guys, put some effort in finishing off the little bugs - and thanks for a useful tool.

4 comments:

Anonymous said...

I am more pessimistic in nature and some 'little things' can cause me to go into overall negative opinion about particular technology, but I am giving Maven a chance right now.

Or rather I've just choosed someone to do it for me and I'll see how he'll struggle.

Ed Burnette said...

Have you read the 'Better Builds with Maven' book? Lots of good info in there.

Unknown said...

Yes, "Better Builds" is definitely a good introduction. It's just that as soon as you leave its examples you're in for some mostly not-so-pleasant surprises.

Anonymous said...

I was using maven the first time in my project now, and I really like what I get ( I read betterBuilds and it helped much).
The only issue I have with maven currently, is that some xml configuration is too verbose.Perhaps using groovy as config language could help