Maven ? Ant ? ...or Gradle ?!

Are you using Maven ? Or maybe you hate Maven and you still use Ant ? Or maybe you feel that both are not enough and you are looking for something else. Than look no more, cause Gradle offers what you need.

Before I begin few words about myself in context of build tools:

  • experienced Maven2 user with more than 3 years of active usage,
  • some Ant experiences,
  • quite happy with Maven2, and able to do "everything" using it, but many times quite irritated by Maven2,
  • interested in build tools especially because I love to automate stuff :)

It all starts with GeeCON 2009...

So the story begins during GeeCON 2009 conference in Cracow, Poland. Befor GeeCON I had only a vague idea that something called Gradle exists.

On of the sessions was held by Hans Docter, the (co-)author of Gradle ( I listened with real interest to what he was saying. First of all, he pointed out some fundamental characteristics of the most widely used tools in Java part of the world - Ant and Maven. The things he said - (about the limitations of XML, about Maven being the only build tool that doesn't allow you to express dependencies between various tasks, about the frameworks that at some point tie your hand etc.) - were a very good wrap-up of the current state of build tools and made me think about this a lot.

The rest of the talk was devoted to Gradle, the build toolkit (Hans cited Erich Gamma "frameworkitis" description and made it very clear that Gradle is NOT a framework) that he develops.

Short and messy list of things that attracts me to Gradle

I don't want to repeat stuff that I already said about Gradle in my previous blog post, so here is the short (and quite messy) list of things that attracts me to this project (please notice, that the order of things is rather random).

  • Opportunity to learn Groovy (something that is already on my ToDo list).
  • The Gradle community seems quite active (check mailing lists).
  • I can see a lot of commits in the SVN and a lots of movement on JIRA - it looks like Gradle is under heavy development. Definitely a good sign.
  • Till I met Gradle I was quite sure that I can do just about anything using Maven + Ant (or Maven + ant-maven-plugin) duo. After some time spend with Gradle I see that I took for granted some limitations imposed by Maven and Ant. Gradle is more flexible and allows me to do stuff I haven't even dreamt about.
  • Gradle is used to build Gradle - somehow it feels reassuring that they "eat their own dog food" :)
  • Gradle uses Docbook to create the documentation, and personally I'm a big fan of Docbook (in general I like what simple text-based formats offer in terms of ease of use, how they facilitate team work etc).
  • I have seen so many articles / tutorials / guidelines / user guides that were full of irritating and misleading typos in code snippets... I appreciate the fact, that Gradle's user guide is free of this problem. How do I know ? Well, all the code is included automatically from the source code (check ExtractSnippetTask.groovy if you want to know how it works).
  • Gradle is aware of the competition, tries to take what's good in it, tries to stick to "standards", but at the same time tries to be a step ahead of the competition. I really like the painless migration from Maven and Ivy.
  • It is so easy (and "natural") to do some things with Gradle, that would be very hard to achieve with Maven or even with Ant.
  • It's good to see that you don't need 6 lines of xml to define a dependency.
  • Many impressive features are planned (and even yet without them Gradle offers a lot of nice things).

Drawbacks ? oh, plenty of them !

Is Gradle a "silver bullet" that will solve all your problems (without introducing new ones) ? Definitely NOT !

The list of issues is still long (see Gradle JIRA), and some fundamental features are still not implemented (for me number one is ability to access password protected Maven repository). But I have a strong feeling that Gradle will rule one day.

Me a commiteer ? No... it can't be...

Gradle made such a good impression on me, that I decided to involve in its development.
I issued few bugs on JIRA, fixed few typos in userguide (or even rewritten small parts of it). Right now I'm working on making documentation examples much more useful (giving them meaningful names and creating a list of examples - see this discussion thread). Unfortunately, I have no time (nor skills) to develop any real code for Gradle, but who knows, maybe one day I will.

...I feel like paying back my debts to the open source community :)

So, will Gradle be "the number 1" ?

Oh, no doubts about it !

I have set my expectations high. So Gradle, don't you dare disappointing me ! :)

I like it, too

We have been using gradle exclusively for new developments for the last year, and are quite happy with it.

Be aware, though, that gradle introduced incompatible changes between the 0.5 and 0.6 releases. It's no big deal, but you have to update your build scripts.

This used to be my blog. I moved to long time ago.


Please comment using