loading...

JVM devs who prefer Maven over Gradle, what are your reasons?

erikthered profile image Erik Nelson ・1 min read

I've personally always found Gradle more intuitive to use and of late they've been shipping a lot of tangible improvements. However, I still see a lot of people who prefer Maven and I'm curious as to what the reasons are that drive that preference.

Discussion

markdown guide
 

I'm always perplexed when I see the vast amounts of people who use Maven over Gradle. This is especially prominent in the Spring world, I've tried out both and have chosen Gradle 100% of the time, Groovy seems so much easier to work with than XML.

 

It might be not obvious at the first sight, but whole Java ecosystem is mostly built on top of maven dependency management. In other words, maven is the native tool for this purpose. And while POM syntax is clunky and verbose, maven is the tool which introduces important innovations/features (like BOM's or support for recent Java versions), rather than one that catches up. Maven is better supported by IDE (and importing it into Idea does not take ages). From my personal experience I can add, that I never had issues with artefact reproducibility with maven, only with gradle.

After all, gradle is just plugs in into maven ecosystem, not vice versa, so why bother with yet another intermediate layer?

 

I would personally prefer Gradle over Maven for following reasons:

  • Performance - gradle supports parallel builds this making possible to get fast build times. Maven sucks at this (maybe till version 2, don't know current state)
  • Readability: yes, it's more readable than tons of xml's
  • Reusability: it's much easier to write plugins and extract parts of your build in separate files.
 

Personally, I like the idea of gradle, but don't like groovy. For me, groovy is counterreadable. If only there was a way to do the same with plain Java...

 

Maven was the only game in town when I got started with Java, and I just plain don't like Groovy.

 

The Kotlin DSL is stable and usable now, so that's worth a look to avoid Groovy.

 

Maven's more than enough for most projects and, given it's older than Gradle, I guess people think "why change?"

 

When I started out everything kept telling me to use Maven so I did, then I worked a bit on Android and I found myself checking out Gradle.

🙊