(or Maven Doesn’t Suckā¢)
My colleague David recently wrote a controversial post on Maven and what is wrong with it. As his neighbour in a cramped office room, I feel compelled to give my own opinion about it. Which fits in a few words: it ain’t too bad.
Maven did get some things right
My argument is that Maven did help teams to Get Work Done, mostly by paying less attention to the build system. I enjoy playing around with build scripts and the like, so I’d rather dabble more with them, as I used to in the heydays of Ant. But I can’t justify it anymore. Maven has allowed me to concentrate on more value-adding work.
But, obviously, that does not make it an all-around Good Thing. It does have its flaws. Yes, the dependency system is not great (I believe this can be partly alleviated with proper unit testing). Yes, too many people use it in too many situations. In a word, the paradigms in Maven break when pushed too far.
Well, couldn’t the same be said about Ant, Java, Microsoft Windows, or even computers?
Leaky Abstractions
All these things are Leaky Abstractions. They try to make our life easier by hiding the complexity, while in truth there will always be a point where the abstraction breaks down. This happens pretty much any idea is made concrete by some implementation. There is an inevitable point or situation where is does not work anymore. That is part of life, and no other build system will ever perfectly.
So they ARE lying then!
Of course they are. Nobody ever sold anything by saying “well, our tool is reasonably good, but keep in mind that it does not work in many situations” (and even open-source projects need to sell themselves). No, they must always oversell a bit, if they want a fighting chance (check out the website of any software if you do not believe me). If that means that some users will later be disappointed, that’s a chance they are ready to take.
So, what can we do?
If you are so inclined, feel free to provide your own solution, as long as you make it available to the world. But be aware that, despite all its benefits, at some point someone will come and bash your little tool, for the right reasons.
Or, you can periodically survey the available tools and change every time one seems better. Or wait for an external consultant to come to your project, laugh at you and point you to this new thing that “everybody is using.” But, in the end, if you want to keep your sanity, always take claims with a large pinch of salt.
After using Maven for a few years I’m still conflicted on whether Maven is a good thing or not – which probably means in my opinion it is a bad thing :)
I hear you when you talk about not being able to justify messing around with your own build scripts since Maven is “good enough”. However, in my experience if you want to do something slightly different to “the Maven way” (i.e. something not directly supported by the Maven plugins, or even if you have to fix bugs in the plugins) you are in for a universe of pain – the Leaky Abstraction.
A small annoyance I’ve had with Maven is “repository bloat”. If you keep adding new versions of JARs to the repository and are not diligent about removing old versions (which may be problematic if you need to build an old version of your software) then the Maven repo keeps growing and growing and growing :) I still prefer to check in JARs instead of pulling them from a repo. But that’s just me :)
Nice post about Maven.
Pingback: Faster tests, at CITCON Paris 2009 « Eric Lefevre-Ardant on Java & Agile