Shane Bell

My thoughts on... well, anything that springs to mind really.

Thursday, January 05, 2006

 

Maven 2.0

When I first heard people talking about Maven I thought to myself "Why do we need another build tool? Ant does a fine job thank you very much". But then curiosity got the better of me and I went and had a play with Maven anyway. But at that point in time the project was still in its infancy and the documentation was a little sparse. So after fumbling around for a while I decided that Maven demanded more time and effort to learn that I cared to spend and I gave up, convinced that I was better off with Ant anway.

But then a couple of months ago, Maven 2.0 was released and I decided it was time to give it another go. And I must say that things are a whole lot better now. However, I don't think I'll be saying goodbye to Ant just yet.

The underlying concepts behind Maven are its strongest feature. Maven encourages you to do things in certain ways - to follow best practises. And by doing so it makes the world a better place for everyone. Most developers have a standard Ant script they carry around with them from project to project that does most of the things they need. When a new project starts, they dig it out, tweak a few things here and there and they're up and building. But the thing is, everyone's script does essentially the same thing. They all compile, test, package, deploy etc. It took Maven to realise this and decide that if everyone structured their projects in much the same way then we could do away with all this boilerplate and just start building. And that's exactly what it does. So long as you adhere to the Maven standards, it will happily build your project for you with very little config. It's "configuration by exception" which has become the norm these days with most tools, Hibernate and EJB 3.0 are two popular examples that come to mind.

However, there's quite a difference between getting a simple example working and using Maven in a real project. It took quite a bit of effort to get a side project of mine up and running with Maven. It's a real shift of mindset moving from Ant to Maven. There were moments when the documentation let me down and I had to spend a little longer than I would have liked to figure things out, but in general things were pretty good. I'm pretty happy with my experience so far and will definitely continue to use it.

The tool support for Maven 2.0 is moving pretty quickly. There are already plugins available, and development is progressing rapidly on others.

The one thing I do love about Maven is it's site building capabilities. Have you noticed that the home pages of all the Apache projects look remarkably similar these days? Well that's because most of them use Maven to build the site. It's simple and easy to use and produces a really slick looking site. In fact, even if you don't use Maven to build your project, it's worth using it just for the site building tools!





<< Home

Archives

October 2005   November 2005   December 2005   January 2006   March 2006   May 2006   August 2006   September 2006   October 2006   November 2006   May 2007  

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]