Some time ago I looked at my Ant files, maybe a 1000 lines each, and I thought: this needs to change!
With Ant, everything is possible, but at the end of the day you just copy your Ant stuff from your previous projects to your new ones because things like compiling or running tests require a lot of boring and mindless XML coding, so you want to save yourself from it and do a bit of copy-paste instead. That's a little sin everyone commits. No need to mention that it quickly becomes hard to modify and maintain.
The long awaited solution?
So I decided to try Maven. Everyone has probably seen the Maven adoption curve by now, I'm sure. Nevertheless, I called Maven to the rescue and... now I'm looking at 1000 lines long Maven files. Great.
Wait a second! What about those promises that Maven is so concise compared to Ant? What happened to convention-over-configuration?
Okay, so a large number of those 1000 lines is dependencies. But then - have you ever tried integration tests with Maven? Not supported by default. Copying a file after the build is done? Hmm... problem. What's more, I've seen people posting questions about Maven and getting an arrogant response similar to "If Maven can't do it then you're doing it wrong; you don't need it, you just don't realize it yet". Quite buggy support for Maven in Eclipse (and IDEA, I heard. Update 2010-03-02: However, Lieven suggested that IDEA support has been greatly improved, thanks Lieven. I tried it myself and found it a bit rough (how do I even add repositories? I can't modify the list), but at least it works.) is another thing... Eventually, I even mastered writing Maven plugins.
This stuff makes your pom.xml file damn long! That's not what we wanted!
The consolation for Maven
Anyway, the list of problems with Maven is quite long and it is not my intention to write another one. Don't get me wrong, Maven is a fair tool, it does bring some conventions after all (at least the projects look similar which makes them easier to pick up) and at least it solves the compilation, unit tests, and dependency management for you (but then, some say it is too much for one tool and against the Unix philosophy - do one thing well).
Now, what would I like to see in a project management tool like Maven?
- Relieve me from tons of XML
- Provide application-type-specific solutions (something like JEE Profiles?), more sophisticated than just selecting the output file extension
- Provide support for more than one kind of testing
- Allow for scripting flexibility (like Groovy or Scala; this is happening)
- Support all JVM languages seamlessly
- Nice documentation
I don't regret trying Maven and if you haven't done it yet yourself, it's time to get your feet wet! But before you decide to migrate to Maven, perhaps you should:
- Wait for Maven 3 - with Groovy instead of ugly XML
- Try Gradle instead; you may also want to read this nice article by Aaron Freeman
- See other Maven alternatives
To conclude, I think that Maven is a righteous step on our difficult and perplexing road leading to a mature and flexible project management tool so that
Please feel free and encouraged to leave your thoughts below the article.