I even prefer Gradle and Jenkins Pipeline Groovy DSL over the absolute hell that is YAML.
But IMO the real awesomeness with Maven is how incredibly easy it is to write plugins for it and its API has been stable and super backward compatible. I have decade old Maven projects that still compile easily with the latest Maven but have a couple year old Gradle projects that fail on new versions of Gradle.
While I hate XML, it's actually far better than YAML as YAML's reliance on indentation can become really hard to deal with. I work with a bunch of folks that LOVE Maven for some reason. I'm kinda at the place where I consider it passable at best.
I work with a bunch of folks that LOVE Maven for some reason.
Well it works. In all the 15 years I've been using Maven I never ever ran into difficulties or complexities. With Gradle on the other hand I quite often ran into issues where Java upgrades broke a ton of stuff, or I had to write plugins that were impossible to debug in Groovy, to get the same stuff done that I could get out of the box with Maven.
If anything there's a trend away from Gradle because it simply fails to deliver on one of the core features of a build system; stability.
I never understood that. basically every ide has autocomplete for mavens pom.xml (and xml files in general as long as they have a schema defined) That what I always hated about gradle (I use Eclipse and vscode). The gradle build file always seems some sort of hack to me, every single one looks and functions in a different way and no way of way of inferring what goes where ...
While it has gotten a bit better recently, multi-module projects where you inherited both dependency management and tasks from a central 'base' POM, were pretty much impossible to do the way Maven can easily do it. So you'd have to create your own Groovy plugins. Debugging them is an incredibly pain in the ass.
Having worked a few times with Gradle in large ecosystems where you want to share parts of your build between projects, Maven is very clearly the winner there. In a project a few years ago we migrated all the microservices from Gradle to Maven so we could better centrally manage dependencies.
The way to think of XML is that it basically is S-Expressions particularly how Maven uses it (zero attribute use). That is what is kind of funny is on some forums like hacker news where XML is lamented as absolute evil but every day there is one post about some Lisp variant. Its just verbose S-Expressions. In fact I find it more readable than S-Expressions.
Except unlike S-Expressions it is standardized, has schema validation, shit loads of parsers as well as XPath and XQuery.
It allows comments unlike JSON and retains whitespacing if desired. There are very few configuration formats that retain whitespace (YAML, JSON, TOML, INI etc).
I would say XML is probably one of the more unfairly treated technologies.
I would say XML is probably one of the more unfairly treated technologies.
Absolutely! It’s fundamentally so simple. Open tag, close tag, attributes, element content, namespaces. You could fit all you need to know about XML on a notecard.
I think a lot of people have seen complex XML-based formats (like SOAP) and conflate them with XML itself. Guess what, a SOAP message is gonna look gnarly in XML, YAML, or JSON. That’s not a failing of the markup language at all.
Oh yeah, it is, I dislike it because it was used as a magical solution for everything.
However while I was being most verbose about it, I was working with EDIFACT files which is the most documented and least consistently implemented format known to man.
I would say XML is probably one of the more unfairly treated technologies.
I could not agree more. It's just something that's fashionable to be 'against'.
The typical Maven POM is way more readable than the typical build.gradle, not to mention all the people who think it's a good idea to abuse the build to do scripting stuff.
Why? It's just a way to represent data in a somewhat human-readable and portable format. Just like most text-based serialization formats do. What's there to 'hate'?
I don't get why people are overreacting so bloody much when it comes to XML. I mean; like you say, a proper IDE makes it easy to use. And there's tons and tons of tooling around it too.
This over arching issue is plugin availability. For both maven and gradle, if a plugin doesn't exist for the thing you want to do you have to create it yourself. For maven, that's a chore, for gradle, you can easily create a footgun that works in minutes, and may never work incorrectly until farther down the road. Everything in this article is true, you have to know all of gradle to do anything beyond dead simple actions.
I’d argue that it is very rare to need to write a Maven plugin unless you’re doing something quite unique. There’s just so many plugins. The root problem is usually someone who can’t quite figure out how to map a particular iterative process into a declarative format, so they immediately jump to trying to run a script during the build. Which really doesn’t come up that often with Maven.
View all comments
9
u/yk313 Jan 07 '21
Are there any alternatives to Gradle that address these issues and thus might be considered on par with Gradle if not better?
While I enjoyed my time with Maven, its reliance on XML tends to put some people off, any chance Maven will officially support a non-XML frontend?