Java Build Tools: Ant vs. Maven
Maven is crap, Ant is better, Rake for the rescue...
Yet another blog entry (updated) to support my approach in the last 6 years...
Maven is crap, Ant is better, Rake for the rescue...
Yet another blog entry (updated) to support my approach in the last 6 years...
Comments
Take a look at http://buildr.apache.org. It is built on top of Rake and adds multi-module support, Java support (compile, package), remote dependencies (following maven repositories, but can be customized) and ability to use Ant tasks.
I used to think this is the winning approach. However, experience at a client shows this may not be the case:
1. the DSL is still ruby. As the build does more and more complex stuff, the ruby syntax leaks through. A developer writing a module and wishing to add it to the build doesn't want to learn ruby to do this.
2. Rake (and therefore Buildr) offer more fine-grained and file-based tasks. Somehow (I don't know why), this doesn't "compile" well with many.
3. No IDE plugins available to manage buildr/rake build file. E.g., in Eclipse using maven I import my projects and immediately get the dependencies resolved, sources attached.
I would consider the winning approach to be either:
1. a tool where the build logic is in Java. Sure, it will be very verbose and not DSLish, but it is what the developers know.
2. a layer over tools like rake/buildr/gradle/gant where common definitions of modules, dependencies etc. is done in a declarative way (e.g., yaml)
I agree maven sucks, but the approach of being inside a box has proved itself valuable when many developers work on the same project and when new developers are joining, which is what happens for most of the world, and that wins.
I'm sure that also with rake or ant you soon find yourself with complex build scripts that only their author can read. where with maven you can always fall back to ant and do the same.
maven sucks but currently the best there is for java projects, buildr looks like its lost in space, people's nature is to evolve and I'm sure a superior build tool is on the way..
An ant and an elephant are playing hide-and-seek near a place which has 1000 temples. The elephant starts counting. The ant goes into one of the temples and hides. The elephant finishes counting, and within a few seconds knows which temple the ant entered. How does he know which one?
The ant left his slippers outside the temple.
People don't "compile" with Rake/Buildr because learning a new language just to get their build running seems like an overhead. When you think about it - they're right... However, "ordinary" developers shouldn't care about the build... it's the job for the "system" guys, and they, well, they should know ruby...
About the IDE support. IntelliJ has support for Rake and Eclipse, hmm... Eclipse isn't something I call an IDE. I get more productive with TextMate.