maven + gradle


I’ve become a big fan of Gradle recently.  It has all of the dependency management capabilities of Maven and being groovy DSL, provides a very convenient mechanism for ad-doc platform-independent scripting.

I’ve been finding a frequent need for build-time processing of XML files recently and groovy handles this very nicely.  Gradle allows it all to be packaged up into a tidy cross-platform execution framework.  No need to deal with native ruby/python/perl packages.  I’ve used JRuby in the past with success, but Groovy/Gradle is much simpler and feels more native to the JVM ecosystem.

While bootstrapping a gradle client installation is remarkably easy with the Gradle wrapper, it turns out to be surprisingly difficult to invoke gradle tasks from maven.  Invoking gradle from maven is desirable if you have some groovy scripting magic that you’d like to execute, but don’t want to convert the build system to Gradle.

So here is a simple maven plugin that makes it ridiculously easy to invoke Gradle from Maven:

Source is available at GitHub and the plugin is distributed via Bintray.