Posted by fabriziogiudici
on March 21, 2009 at 5:54 AM PDT
Necessary introduction: this post is not about Ant vs Maven (it would be Yet Another Completely Useless Discussion), but on how it is possible to find a diplomatic agreement between antists and mavenists. So, please don't comment about how Maven is better/worse than Ant, as everybody knows that such discussions never reach a final conclusion and most people stays with their original ideas; instead, please comment about the idea at the end of the post.
First, the background. Friends often say I'm a contrarian, because e.g. I'm known to hate football, Apple , FaceBook , or Twitter , and Maven is in the list of hated things as well. Indeed I don't see myself as a true contrarian, rather as a pretty picky person who'd like to do things with awareness. For this reason, I wouldn't say I "hate" things (even though I use the term for simplicity), being my decisions based on rationality rather than feelings. For instance, I was not against FaceBook in the principle and I even subscribed an invitation some friends sent me at some points. After learning more about it I decided it was useless and dangerous . To prove my point further, I've got some opposite example: when Gianugo Rabellino first suggested me to use Wicket I was skeptical. I can say I even "hated" Wicket for the first two/three days I was playing with it since some things seemed pretty absurd. Nevertheless, I do listen to reputable persons such as Gianugo, so I literally forced myself to trying it a bit longer before giving up. The result is that Wicket has been my primary choice for web applications for two years now.
In the same way, lot of reputable friends from JUG Milano , JUG Genova and JUG Torino advocate for the use of Maven, and indeed I tried to use it a number of times (also because NetBeans has a pretty good support for it, to be greatly improved in 6.7). Nevertheless, I've always found it a completely useless piece of complexity, as none of the alleged "features" of Maven is a positive point in my opinion.
If you're curious, my biggest point against Maven is about reproducibility and control. Everything in my projects must be completely reproducible, so everything but the JDK is committed in Subversion, including QA tools such as Cobertura or Findbugs ; I don't want to depend on somebody else's repository, neither I want to waste time in setting up mine; I want to always understand what's happening and be able to make a temporary patch, an easy thing with Ant and headache with Maven; at last, I've refactored my build environment in the tools subsection of OpenBlueSky and I need about one minute to set up a new project with the same standardized structure, so archetipes don't give me any real plus.
A few days ago I made another attempt: another small piece of blueMarine is of interest for a paying customer who uses Maven. Since this is originating yet another spin-off subproject, which is tiny, I supposed that tolerating Maven there was acceptable. But when I tried to integrate the Cobertura plugin for Hudson and found that not only it was broken, but also broke the whole Hudson (as confirmed by others), I got literally furious. Yes, technically it's not a Maven bug, but the quality of a product is related also to its ecosystem, and I have never found any serious bug with Ant while it seems there's always something broken around Maven.
Patiently answering to my rants in a private email exchange, Marcello Teodori gave me a good hint: try to make Maven and Ant co-exist. He's doing the same thing in VqWiki .
So, since Maven is the intolerant one while Ant is flexible, the solution I'm trying is to keep the same directory layout as Maven (e.g. src/main/java) and make Ant to work on it. pom.xml only contains stuff for making a build and testing it, while build.xml also contains all the Hudson stuff in the way I like. Maven will use a repository for libraries, while Ant will use jar files committed with the project. I'll develop the project with Ant, but take also care of not breaking Maven compability (with Hudson help), so my customer will be able to use Maven. If the thing proves to work, I might even extend this to my other JSE projects.