zome_build_system

Alternatives for Maven, Building With Less Frustration

Reader Nacho Coloma got me thinking. A few weeks ago he mentioned Gradle as an alternative for Maven. Now I’m not ready to throw out Maven, but the alternatives are at least interesting. Most popular alternatives have one thing in common: they shy away from XML in favor of domain specific languages (DSLs). Those DSLs are in many cases a subset of some of the more popular scripting languages.

Read on for more about Gradle, Gant, Rake, Raven and Buildr.

Gant

Groovy Ant scripting, no dependency management or extras.

If you’re still used to Ant build files and presumably doing most of the dependency management by hand, than Gant is probably a great choice for you. It hides the Ant XML that can become very unwieldy and syntax heavy in favor if more focussed Groovy.

That’s all there is to it. And that’s the attraction.

Gradle

An up-and-coming star in the build world. Groovy, Ant and Ivy combined.

Wherever you go, Gradle is on the lips of many developers. Aaron explains it a lot better, but if you like the Groovy syntax and want a little more substance to your build tool than Gant, this might be your best choice.

The result are very small, condensed build files. Reading them feels natural, most of the things I see in the documents, I can guess what it will do. I’m not sure if writing the files is just as easy (but than again, Maven is difficult both reading and writing the files)

Rake

Ruby Make

Personally, I must confess, that I found Rake the most inaccessible of the bunch of tools I describe here. I’m sure it’s not because of the documentation (there is a lot and most of it pretty clear). Even Martin Fowler seems to like it, although the linked document is fairly old.

I think it’s because Rake files are not only written in Ruby, but it’s also very focused on Ruby development. I haven’t really developed much in Ruby, so I think that’s why some of the most basic constructs look slightly outlandish to me.

I also didn’t look too deep, because if you want to use Ruby to build Java, there are better options.

Raven

Java building with Rake

As the site proclaims, this is really Rake adapted for Java building. It further combines this with Ruby Gems. At its most basic, you could compare this with Maven’s dependency management. In fact, there is an adapter available that allows you to convert a Maven repository to a Ruby Gem one.

Raven has specific tasks for Java development (javac, war, etc.) which makes it easier to use than plain Rake.

Buildr

Ruby Java building with Maven repositories

Buildr is the second Rake spin-off for Java development. For me, it has one major advantage, it uses the Maven repositories directly and also has the “Maven style” of specifying dependencies (group, artifact, version, scope). Buildr claims on the front page, it’s a drop in replacement for Maven. That is a very powerful selling point.

Buildr too is built on Rake, so it’s pure Ruby, which will take a little getting used to. However loosing the endless xml-tags is something you’ll probably get used to right-away.

Conclusion

I think I summed up the most important innovations in Java building, as always, please correct me! If you like Groovy, I’d suggest Gradle. If you prefer Ruby, go for Buildr (especially if you already have Maven repositories set up). But mind you, none of the others are bad choices, they just serve slightly different purposes than what I am currently looking for in a build tool.

Feel free to use the comments and share your personal preferences.

(image credit)

6 thoughts on “Alternatives for Maven, Building With Less Frustration”

  1. I’d like to suggest one more for your list: The “simple build tool”: https://code.google.com/p/simple-build-tool/
    It’s a scala build tool in the first place, but equally supports building java. It includes it’s own dependency management, but also offers the option to use Ivy or Maven files. And for behavior or test driven design it contains a very valuable feature: You may trigger a task as to be repeated if project files on disk change – a bit like the tool “autotest” in the ruby world. Unfortunately JUnit is currently not supported. But a respective extension should be easily done, since the supported test frameworks all are required to implement the same interface. So in my opinion this is potentially a drop in replacement for maven too – and a bit more ;-)

  2. Hi… are you talking about “building” or “project management”? are they real alternatives to every feature provided by maven? i don’t think so… moreover… why a DSL should be better than an XML project descriptor? I think it is more specialized, so it is for less people…

    bye

  3. Of course it depends on your preferences. Me, I hate the elaborate way of specifying things in Maven’s XML. If you can live with that, there really is no reason to switch.
    Many of the alternatives proposed here can do much more than building. You’re probably correct that some of the more advanced Maven features aren’t always supported. It’ll depend on your way of working whether or not that’s a problem.

Comments are closed.