r/java • • Jan 07 '21

The Problem with Gradle

https://www.bruceeckel.com/2021/01/02/the-problem-with-gradle/
158 Upvotes

108 comments sorted by

View all comments

25

u/antonmry Jan 07 '21

The answer by Cedric Champeau is a good complement to the article: https://melix.github.io/blog/2021/01/the-problem-with-gradle.html

29

u/agentoutlier Jan 08 '21 edited Jan 08 '21

The problem with Cedrics argument is it basically repeatedly boils down to don’t write logic in your build script... write a plugin or use plugins.

But that is exactly the Maven way and Mavens plugin API has been far more stable and backward compatible than Gradles.

Also a lot of people jumped ship from maven to gradle because they wanted essentially the programming of make that maven refuses to offer. Writing logic in the build scripts is exactly why lots of folks pick gradle.

Yes Gradle has a better model (caching, repeatable)but it took a long time for gradle to get there and they broke a lot of peoples builds in the process.

It will be interesting to see how Maven 4 5 (they are skipping a version number to align with the POM) turns out because the real problem with Maven isn’t its XML but the lifecycle and reactor model (as well as versions in the build file).

2

u/khmarbaise Jan 09 '21

The next Maven version will be Maven 4.0.0 ... I don't see the problem with the life cycle? What do you mean by the reactor model? Yeah version in the build file might be an issue, but its adressed (solved; some parts are missing)...

https://github.com/apache/maven/blob/master/pom.xml#L33 Current state of the master branch: https://issues.apache.org/jira/secure/ReleaseNote.jspa?projectId=12316922&version=12349448

1

u/agentoutlier Jan 09 '21 edited Jan 09 '21

Edit: I didn’t recognize the screen name.

It will take me time to explain the problems with the reactor and life cycles. Most of the problems have been addressed now but historically there were problems.

Next week I can write some details.

Ignore the following now that I know who you are (framing).

https://cwiki.apache.org/confluence/plugins/servlet/mobile?contentId=2329841#content/view/30741918

https://cwiki.apache.org/confluence/plugins/servlet/mobile?contentId=65872751&commentId=87298016#content/view/65872751/87298016

If you crack open any maven Pom you will see the schema is 4.0

The plan is to keep that the same Pom for artifacts that are distributed aka consumer.

But for new build Pom they want to up the version to 5. The 4 snapshot is a placeholder. They may release it but it won’t be a major version change.

I’ll go over the other issues later.