It's a lot easier to explain Maven in 15 seconds, but so far everyone tries to explain Maven in 15 hours instead. With that version, even 15 hours might not be enough....

Here is the 15 second version:

Maven treats a build script as an exception, compared to Ant or Gant or Make or shell scripts which treat a build script as a prescription.

In Maven, the only thing you write is the part that is different from a standard build. Having that standard build is the essence, not your script.

So let's review:

  • Ant, Gant, Make, shell scripts or even just build documentation describe HOW to do the build.
  • Maven "script" describes WHAT you do that is different than a standard build. So it's really not a script then, is it ?

It is this critical difference between how and what that makes Maven not understanable if you don't get that first.

Change one file name and Maven could double it's adoption in 3 months:

Rename pom.xml to build_exceptions.xml and Maven becomes totally understandable, even in less than 15 seconds. People who really don't understand Maven would all of a sudden get it.

People all over the world who are avoiding Maven like the plague, and spreading chaos in the form of unique build.xmls would see the easier approach.  "Oh," they might say. "I get it. It's not about writing a good script, it's about NOT writing a script, and letting standardized build structures do it for me"

In Maven, even what you do write is not really a script, like it is in Ant or Gant or Make or even a shell script. What you are instead writing is a description of what to do. The script is written inside the maven plugin. So what you "write" in Maven is what plugins to call. Completely orthogonal to writing a script.

"Well if that's all Maven does, is stick to some standard build structure, then I could do that." I can hear the throngs of programmers rushing now. The feel of the pavement shaking under the thunder of their feet is overwhelming already.

If it was a build.xml, it would suck.

If you have to write a script, or a how prescription, you are already going down the muddy path...

Graeme Rocher, who has to be one of the most brilliant minds in the software industry to emerge to date, puts it best when he says in his blog that "Fact is XML is not the right choice for a build language, period. Whether it be Maven or Ant." Graeme Rocher is the creator of Grails, itself an amazing project.

Grails is a perfect example of when you need a script, not a Maven. Everything about Grails is non-standard, and that is what makes it great. Not even any packages, hell it figures out what to do by what directory you put the groovy file in. Holy shnikes Batman, no wonder he hates Maven. When you start by breaking all the rules, you need  scripts.

In a prescriptive system like Ant or Gant or Make you have to say things like "Go get those files over there and do this one thing to them and then move that to that folder over there." Hell's bells, if you have to do that in Maven, you already know something is wrong. Maven's plugin already knows where the files are and where they go. You don't write stuff like that, you write stuff like "Oh, and by the way run that foo plugin too, with this one foobar setting."

Graeme is right about xml as a crappy language for scripts. Gant beats Ant in a millisecond. Writing Ant scripts is horrendously painful after you write your second or third Gant script. Try one, it will make a believer out of you quickly. And he is doubly right about Maven if you are writing prescriptive type of scripts. That would suck.

Reviewing the Good Life as a programmer

So let me tell you what happens when your life as a programmer becomes pure pleasure. It's when you can work. It's when you can write code and build it and not worry about setting up builds or figuring out other people's build scripts that are weird compared to yours or anything other than just plain old dumb coding.

With Maven it doesn't even matter IF YOU HAVE NEVER SEEN THIS PROJECT BEFORE IN YOUR LIFE. You are already working. Hi ! Bye. Done.

You go to the subversion or cvs of whatever project you are interested in, you checkout the project, you run mvn whatever. Period. The end. Nothing more. Click, click, click. Boom. Thank you very much Mam.

Then you make one change, run the build again, it handles everything, and you know what build to run because every project is the same no matter who built it. You are done.

That is what makes life sweet as a developer, being able to work. Easy, fast, dumb. I love it. I'm not going to give up either.

All we have to do is rename pom.xml to build_exception.xml and everything else will follow.....


[EDITOR'S COMMENT:] This blog has comments left on a previous location here