Gradle vs Maven

Short story

Don’t use gradle. Use maven.

A little longer story

Don’t use gradle until you really have to. Otherwise use maven.

Long story

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!

Update (07.09.2018):

Some nice blog-post in this context:

Update (19.05.2019):

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.

About krzysztoftomaszewski

I've got M.Sc. in software engineering. I graduated in 2005 at Institute of Computer Science, Warsaw University of Technology, Faculty of Electronics and Information Technology. I'm working on computer software design and engineering continuously since 2004.
This entry was posted in Java and tagged , . Bookmark the permalink.

2 Responses to Gradle vs Maven

  1. ddz says:

    Plus for you that you are brave enough to say that!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s