This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
For me the three main features/advantages of Gradle are:
* It is a real language/DSL, which means you write your build script like you write your code. You can write methods, use variables, types and refactor to create maintainable build scripts. You don't have to write your build in XML, but use a proper language. Also because Gradle uses Groovy you get the best of the Java world. You can use Java libraries and also use Groovy's elegant language.
* Gradle has industry standard convention-over-configuration features. Gradle supports the industry standard conventions (defined by Maven) for project structures, so you don't have to redesign your project to use Gradle. But also the flexibility to easily extend you build with corner cases you need in your build.
* Support for incremental builds really speeds up the build process. Gradle has very intelligent tasks that can check if they need to be executed or not, based for example on changed source files or property values. We can even apply that to tasks we write ourselves.
* Great support multi-module projects. Gradle allows project dependencies and will figure out what projects need to be build if we have those kind of dependencies. If we work on project B, which depends on project A, then Gradle will determine if project A is up to date and if not will build it, before building project B. Also we can check if projects that depend on project B are still buildable if we make changes in project B with a single command.
To migrate from Maven to Gradle can be easy. Gradle supports the same directory structure, dependencies are fetched from Maven repository (if needed). There is a tool maven2gradle but I haven't used it, so I don't know how it works. Gradle cannot (yet) run Maven build of use Maven plugins. So if you are using a plugin, you probably need to write some extra code. A lot of plugins also have equivalent Ant tasks and those tasks can be used directly in Gradle and then the migration is easy.
Joined: Apr 23, 2008
That sounds really interesting and very powerful. I'm going to give Gradle a chance and, of course, to your book.