DEV Community

Cover image for Why I prefer Maven over Gradle

Why I prefer Maven over Gradle

Arnaud Dagnelies on February 20, 2024

In the Java world, one of the first question developers encounter is "should I use Grade or Maven as build tool?". It's a fundamental decision whic...
Collapse
 
khmarbaise profile image
Karl Heinz Marbaise • Edited

Can you please be more specific about Their website sucks IMHO,? file in a jira issue ? Suggest the issues you see or even greater would be to offer a pull request?

The next part: it could welcome YAML as more compact alternative format, while YAML has a lot of disadvantages compared to XML ...yes I know XML is a bit verbose...in Maven 4 there is done a lot of foundation work to improve the format later on...

Collapse
 
dagnelies profile image
Arnaud Dagnelies • Edited

First off, thanks for the feedback. I'm glad to see someone caring about maven.

Can you please be more specific about Their website sucks IMHO?

Well, IMHO it should start with a getting started section, explaining how a basic pom.xml looks like and building it with the command line. That would be a fair introduction. On the other hand, their front page contains either advanced or useless stuff. Just by looking at it, I think most people would go away. Putting something like this, (not trivial to find) on the front page would have been much more useful IMHO. Besides the front page with a tutorial, I'd offer 4 sections: "pom.xml reference", "CLI reference", "Plugins", "Advanced" and "Community / contributing". The current left menu is cluttered while not containing what you look for.

file in a jira issue ?

Well, that is the next problem. Nowadays everybody has GitHub accounts. Just by requiring people to create an account and use another ticketing system, it looses feedback and contributions. You don't want to create accounts for every lib or tool you use.

YAML has a lot of disadvantages compared to XML

While YAML is not perfect, I think a lot of users would welcome a more lightweight way of wrting the configs


The last thing I'd like to add is that some things are also uselessly difficult to do, like packaging a fat/executable jar. Some comfort stuff like a goal to check for CVEs or update all dependency versions should also be included by default.

Collapse
 
grisha9 profile image
Grigoriy Myasoedov

While YAML is not perfect, I think a lot of users would welcome a more lightweight way of wrting the configs

There is polyglot-maven project that allows you to write build scripts in different languages. including Yaml

Thread Thread
 
dagnelies profile image
Arnaud Dagnelies

Yeah, I noticed that too. But it requires you to explicitly search for it, to download, install and configure the plugin. Basically, it's defying the purpose of making your life easier. Whether the plugin works properly and how your dev tools integrate it is another matter.

Collapse
 
rytheturtle profile image
RyTheTurtle

You can effectively implement your entire CD pipeline with Gradle. Maven, at least in my experience, is much more centered around just the build process (compile the code, run tests, bundle up your JAR/WAR).

In every team I've worked on so far, there is some external CD pipeline like Jenkins, GitHub Actions, Gitlab Pipelines, or something else that teams use to actually deploy software. Dedicated CD pipeline tools are very effective at managing and visualizing pipelines and stages, so the extra complexity of Gradle that enables it's fancy features just aren't a compelling selling point. So my opinion on Gradle vs Maven comes down to "doesn't really matter, just give me a command that can compile my code and run unit tests".

Collapse
 
eduardopazz profile image
Edu Paz

Totally agree with you

Collapse
 
gorynych profile image
Stepan Mozyra

When I see a Gradle project, I have no idea what the build script does

Oh, man! Same for me. When I see pom.xml - I have no idea what is going on.

Untill now I thought this is my problem, becouse I don't know Maven. But this artice helps me clearly understand that it's completele Maven's fault!

Collapse
 
dagnelies profile image
Arnaud Dagnelies

Huh?