• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Why gradle?

Ranch Hand
Posts: 82
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody and specially to Hubert!

I wonder if you could list the three main advantages Gradle provides and which advantages I would obtain if I migrate my projects from Maven to Gradle. ┬┐Would be it possible in a easy way?

Thank you so much in advance!
Posts: 13
IntelliJ IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Marco,

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.
Marco Antonio
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Hubert!

That sounds really interesting and very powerful. I'm going to give Gradle a chance and, of course, to your book.

Thank you again!
    Bookmark Topic Watch Topic
  • New Topic