mardi 26 juin 2012

$%$@#!# maven...


Have you ever ended up in a maven build quagmire ? Cornered in a desperate situation with absolutely no idea on how to get out ?

I have always tried to stay away from maven because I have always seen it as a tool to try to overcome lack of communication and of being rigorous inside a development process. And I just don't think that there is a tool to replace that just yet !
Yes, I understand that a tool well done can really be helpful regarding that... But actually from what I have got from it, maven was not it... and actually far from it.

I just remember trying to compile some very simple application and ending up downloading half of the internet... For what should have a been a simple javac call...
Granted, the tool can do so much more, but why make so much fuss before you are actually asked for more ?

Sooooo I had a bad feeling about all this, but always tried to stay away from it... And I did manage to... until last friday... I ended up having many hudson jobs implying maven that just went nuts... and I had to try to get that back on track.

Well, what can I say. I think the dang thing stinks already when everything works, but becomes literally rotten when something goes wrong. And believe me, things will go wrong. Maybe you don't mind having to install your own local mirrors, monitor them, and go through tens of cryptic xml mazes. Well that's your choice, but leave me out of there. I could go on and on about this, but I will let others do it at my place.

Here are the pieces that made me feel better after a nightmarish day:
- A discussion about some bad reputation over at StackOverflow.
- very articulate point of view about various maven problems.

The first discussion gives many insights about the troubles you will (or sadly are) face using maven, and to get used to the fanboys arguments that will make you wish them to face all the horrors that happened to you.
The second is just so very well constructed, that I don't really have anything to add...

To me what is probably the worst point about maven is that as a programmer, you end up with a result (jar or war) that is just probably bigger than it should... And that mostly, you have surrendered the idea of following tightly your dependencies.

What struck me reading this, is that those point of views are old (2010 & 2009) ! And these are so valid today still !

One last point that people should be aware of and that is not mentioned in any article that I have read : once you opted in for maven, if the reproducibility of your build is important to you, then you might end up with a difficult way out. You will have at least to stick with the dang thing until the builds depending on it no longer have to be remade !

Anyhow, don't let the fanboys go down on you saying that they have become a de-facto standard.
The 2012 eclipsecon survey results (go to page 15) shows that even if it has made great progress, maven still only accounts for 42% of the builds. So make they pay the due respect to the venerable Apache ant.

In conclusion, do you sometimes ask yourself these two important questions:
- What build system do you use ? 
- And why ?