Live data from Hacker News

Why I Moved Back from Gradle to Maven

blog.philipphauer.de

151–160 of 172 posts

Re: Why I Moved Back from Gradle to Maven

#151
post #111

Earlier quoted context omitted.

> Focus on Android Studio because that's the only place people really use Gradle because they are forced to do so. False

It is true for us. If it wasn't forced upon us for Android dev no one at my employer would even bother to learn what is Gradle. The opinion is that it is the last spot keeping Groovy alive.

Jenkins also semi-recently decided to go with Groovy for their "pipeline" feature. Ugh.

(They may have good reasons, but anything that prolongs the lifespan of Groovy is a bad thing.)

Re: Why I Moved Back from Gradle to Maven

#152
post #25

Earlier quoted context omitted.

> Now we simply have bash scripts that do all our one-offs that often were nightmares to accomplish in Gradle or Maven. Whether it is JAXB or Docker integration every maven/gradle plugin I ever used was 10 times harder than just bash. This is the opposite of my experience. Trying to get consistent behaviour out of bash scripts is a nightmare (every nontrivial bash script has an undocumented dependency on a particular…

> every time you try to build on a new machine you're rolling the dice why not on copies of known-good machines? vm boxes with the same definitions would alleviate almost all of that 'roll the dice' aspect, no?

At that point you've frozen a working image of your dependencies along with a bunch of other stuff, but you still don't have a clear picture of what those dependencies are and how to work with them.

Your build works in a vm of RHEL 5 with packages x and y installed, ok, now you need to add a new build step that depends on something that's only available for RHEL 7. So you run the VM generate script (if you can even find it a year or two later) and the build doesn't work. Now you get the same fun debugging experience. Standardising which OS and package installs every developer uses (whether with a VM or just with something like Puppet) means you get to roll the dice less often, but it's still a dice roll whenever you want to change something.

And running all your builds in VMs has a cost in terms of performance but more importantly in terms of comprehensibility. If my build is just Maven I can run it in my IDE, then I can push one button differently and run it in my IDE with a debugger attached. If the build is running slowly and I'm not sure why, I can push one other button and now I'm running it with a profiler. Some of that is just an argument for having your build tooling written in the same language you're using for development (if I was working in e.g. Python, I'd be more likely to have a Python IDE and a Python profiler to hand, so would want to use a Python build tool), but even if you're used to working in Bash and C I'm not sure the VM advocates have good answers to how you debug something running in a VM as yet.

Re: Why I Moved Back from Gradle to Maven

#153
post #87

We're planning to add a Maven compatible artifact repository to GitLab. I assume that will automatically also work with Gradle, or is there more to it?

Yep, you can publish to a maven repository from Gradle pretty easily. I just setup a project to publish from gradle -> artifactory last week.

Cool, thanks!

Re: Why I Moved Back from Gradle to Maven

#154

I’m surprised nobody has mentioned buck or bazel in this thread. At Addepar a few years ago, I transitioned a several-100-k LOC Java codebase from Gradle to buck. It was a fairly complex build including Jooq code gen. Build times became much faster and flaky CI issues went away. Today, I’d try Bazel— Buck only exists because ex-Google FB engineers had to recreate Googles amazing Blaze build system. Google has since r…

I would have used Bazel (or Buck) at Addepar instead of Gradle had either been released (I really loved Blaze). The transition from IDE-only to a standard process was painful, as you remember.

I'd like to use Bazel (or even Buck) these days, but no bandwidth given other projects. I always felt modules were a mistake compared to a single large tree, which Bazel does elegantly. Sadly my familiarity with Gradle is much more than Blaze these days, and I'm too exhausted to do it just for fun. I think there is also a bit of Stockholm syndrome at play, since I convinced myself it was not too bad back at Addepar.

Re: Why I Moved Back from Gradle to Maven

#155
post #32

Flexibility is not something I want in a build system. I want predictability and simplicity. "Flexibility" just means that the dumbest guy on the project will find sufficient rope to hang the whole team sooner or later. That being said, "flexibility" is not special to Gradle. As long as there have been build systems there have been people who are too lazy to learn them and get "bright ideas". For instance I have no i…

> Flexibility is not something I want in a build system. [...] "Flexibility" just means that the dumbest guy on the project will find sufficient rope to hang the whole team sooner or later. We're on opposite sides here. I can control my team wrt rope and what not. But it's very hard to wrangle a build system to perform some advanced task you need without flexibility. I'd way rather have problems with the build system…

Perhaps you can control a team, but how many people do you think you can "control"? Could you control every developer in a division? A company? And how do you onboard new people if any past experience with build systems is worthless because they have to learn how you do your particular build?

And if you find yourself consistently not being able to build a piece of software with a relatively simple build process, perhaps you are trying to do too many weird things?

Re: Why I Moved Back from Gradle to Maven

#156
post #82
post #32

Flexibility is not something I want in a build system. I want predictability and simplicity. "Flexibility" just means that the dumbest guy on the project will find sufficient rope to hang the whole team sooner or later. That being said, "flexibility" is not special to Gradle. As long as there have been build systems there have been people who are too lazy to learn them and get "bright ideas". For instance I have no i…

> "Flexibility" just means that the dumbest guy on the project will find sufficient rope to hang the whole team sooner or later. In my experience, it's not dumb but clever which you should worry about — those are the ones who'll spend two weeks making something completely unmaintainable after reading someone's post about how some esoteric mathematically pure style delivered a 7% performance increase on an edge case.

"Clever" is just a polite way of saying "dumb" :-)

Re: Why I Moved Back from Gradle to Maven

#157
post #32

Flexibility is not something I want in a build system. I want predictability and simplicity. "Flexibility" just means that the dumbest guy on the project will find sufficient rope to hang the whole team sooner or later. That being said, "flexibility" is not special to Gradle. As long as there have been build systems there have been people who are too lazy to learn them and get "bright ideas". For instance I have no i…

Lack of flexibility means that it will only work for xx% of projects (supply an arbitrary value for xx but other than 100, by definition). Then what it means, is that 100-xx percent of projects are going to be screwed up. Not everybody lives in a nice world when the project is a single web application with 4 microservices and a shared library maintanied by a team of 5.

Out of those xx% of projects, how many really need the flexibility? Based on the last 30 years or so of being a developer, I would be tempted to believe that it would be in the low single digits.

It is sometimes worth it to spend a little extra time as you set up the build process, and as you make decisions on how to organise things so they can conform to a build process other people will understand. Quite often "clever" builds on long-lived projects, or projects with many developers, have a higher cost in terms of effort than what you save on "clever" shortcuts.

Re: Why I Moved Back from Gradle to Maven

#158
post #156
post #82

Earlier quoted context omitted.

> "Flexibility" just means that the dumbest guy on the project will find sufficient rope to hang the whole team sooner or later. In my experience, it's not dumb but clever which you should worry about — those are the ones who'll spend two weeks making something completely unmaintainable after reading someone's post about how some esoteric mathematically pure style delivered a 7% performance increase on an edge case.

"Clever" is just a polite way of saying "dumb" :-)

It's a different concept — closer to the difference between intelligence and wisdom. Someone who is cleverer than they are wise can go a long way before recognizing that the approach they're taking isn't cost-effective, especially if it gives them some point to feel proud about doing something which (correctly or not) they feel most other people couldn't.

Re: Why I Moved Back from Gradle to Maven

#159
post #80

Earlier quoted context omitted.

>Gradle... It's an environment for programmer! >Maven...you have to write your own plugin. Not nice. >If I wanted to change one thing in Gradle it would be for the Gradle project to focus on debugging You've just explained why I have no interest in Gradle. You're writing one off, undocumented, anonymous plugins, in a weird domain specific language, with debugging tools that aren't very good. Worse, when the Gradle gu…

Yeah, especially code like that: artifactory { publish { repository { repoKey = version.endsWith('-SNAPSHOT') ? 'libs-snapshot-local' : 'libs-release-local' } } } In Gradle, this is immediately understandable to everybody. You can't do this in Maven without plugin support or some very protracted constructs. Sprinkling those small bits makes the Gradle useful. We are not talking about making a beast of a build system,…

You're now contradicting yourself:

>I really find it difficult to figure out why things fail even though I have almost 20 years of experience

>In Gradle, this is immediately understandable to everybody

You pulled an easy example to defend Gradle for the exact problem you just complained about.

>You may not want or like to learn another tool and that's fine.

It's not about like or want, it's about having the wisdom to recognize a poor solution before investing time in adopting it. OP fell for the hype. Maven works fine for me, thanks.

Re: Why I Moved Back from Gradle to Maven

#160
post #55
post #49

Earlier quoted context omitted.

Groovy is actually an extremely useful language to know. Something approximating bash for java, but with capability to scale up to full application development. Gradle would be one of the less important reasons to learn it imho.

I mean objectively it's not a bad language for its era, I just never found a compelling reason to use Gradle rather than something else. When I started out on the JVM I used Jython for scripting tasks since I already knew Python, and once I started using Scala I used that for, well, everything really. I don't want to get too deeply into language wars, but Java, Python and Scala all have "killer" features, things they…

> Whereas Gradle just felt like "it's a Python/Ruby/Perl-like language that runs on the JVM" - if there's something Gradle's actually the best at, their communication failed to convey it

I assume you meant groovy there. But yes, I remember actually posting exactly that view on here several years ago! I felt that if I was going to learn a JVM language, why not invest that effort in something that was more generally applicable or has broader benefits, and kill two birds with one stone? I deep dived into Scala, and looked into Jython, JRuby and other JVM languages. What I came up against every time was that each of those languages seemed to have significant impedance mismatch with the JVM. I found I really wanted something as close to Java as I could get but with a scripting programming style so that I could do quick experimental coding. For me that is where groovy beat everything else. As I used it more I started building larger projects with it because it scales up pretty well. So I often build about 70% of a project in groovy and then do 30% in Java where I want the real static typing (interfaces, domain model, etc.).

This seamless interoperabiity with Java/JVM is a fairly subtle selling point especially since every JVM language will say they do it. It's only when you try to use them in complex projects and see them fall down that you realise that groovy is the only language that is philosophically trying to be close to Java (I'm fairly keen to try Kotlin to see how that holds up on this count).

Post reply on HN