A little longer story
Don’t use gradle until you really have to. Otherwise use maven.
Last time I was dropped into a project that was using gradle. And it was the first time during my professional career in Java (11 years!) I’ve encountered gradle in the wild. Moreover in the team there were 3 younger developers having different degree of experience. None of them knew gradle as well and preferred to use maven. Some 3 years before this in another company at the start of a new project we were discussing what build tool to use. Around 20 people and only one of them proposed to use gradle. I think I don’t have to say we’ve decided to use maven.
Conclusion 1: Maven is much more popular and gradle is just exotic. Maven is familiar to most Java developers so choosing gradle will make it harder to maintain the project.
Maven build files (
pom.xml) are expressed in XML. XML is a kind of a document so maven build files are documents. It’s good. On the other hand gradle build files (
build.gradle) are expressed in something similar to Groovy programming language. That’s make them programs! And as usual in a computer program you can do things in many different ways. And Groovy is even making things worse! There are many optional syntax elements – so they can appear or not (like semicolons – please refer to DZone: Groovy, Sometimes You Still Need a Semicolon.).
Conclusion 2: Gradle build files can be much more messy than Maven build files. Moreover Maven build files are documents you just read while Gradle build files are programs you’re wondering what they do.
Moreover my personal impression was that building a project with gradle is slower than building with maven. It seems others experienced this as well: How to speed up your slow Gradle builds. It’s crazy to use this tool until you really have to!
Some nice blog-post in this context: https://blog.philipphauer.de/moving-back-from-gradle-to-maven/
Because in my professional career I need to struggle with Gradle in some projects I just faced another ridiculous problem: it turned out that I needed the latest IntelliJ IDEA Community Edition (at that point in time it was 2019.1) to be able to work with project having Gradle 5.x build-file. I literally needed to download 0.5 GB of data only because Gradle 5.x couldn’t be handed by IntelliJ IDEA from 2018 while Gradle 5.x actually is not very different from Gradle 4.x.
So before downloading newer version of IntelliJ IDEA I checked out if NetBeans 8.2 I had on my box can work with Gradle 5.x build-files. Nope!
Conclusion 3: Integration of Gradle in popular IDEs is fragile and still causing problems (which results in a wasted time). No such issue with Maven.