Live data from Hacker News

Why Move from Gradle to Maven

blog.astradot.com

21–30 of 44 posts

Re: Why Move from Gradle to Maven

#21

For practical reasons, I have to admit gradle is better than maven. Gradle is least bad. However, I do have to say turing completeness in a build system is an anti-goal for me. You shouldn't have to guess if your build will halt. I've seen terrible things done in builds, and most importantly, static analysis is the point of these systems... it's what makes IDEs able to work. From what I understand the turing complete…

You can download the source build of Gradle and get autocomplete for the Groovy DSL as well. Just change `distributionUrl` to the `-all` build of Gradle in your project's gradle-wrapper.properties.

Re: Why Move from Gradle to Maven

#22
post #17

Earlier quoted context omitted.

If Gradle is fast in comparison to Maven, then I cannot begin to imagine how slow Maven is. A build system that has to spawn a daemon to speed up the process is a pretty shitty one. It takes about 2-3 minutes to do that for me, and still it takes 30 seconds to build my program which is not even that huge.

Are you saying that it takes 2-3 minutes to start the grade daemon? That sounds weird.

Yeah, it does. I have 8 GB memory, and an Intel G3xxx CPU. I am baffled by how slow it is. For people who do not believe me, I am willing to record it, but I have to go to sleep now. :/

Re: Why Move from Gradle to Maven

#23
post #18

Earlier quoted context omitted.

If Gradle is fast in comparison to Maven, then I cannot begin to imagine how slow Maven is. A build system that has to spawn a daemon to speed up the process is a pretty shitty one. It takes about 2-3 minutes to do that for me, and still it takes 30 seconds to build my program which is not even that huge.

Something is wrong with your setup methinks. Gradle daemon starts in a second or so for me on the two Java projects on this machine (around 20koc each) and like one second build times...

What could possibly be wrong with the setup though that would cause it? I have a couple of dependencies, including libGDX, artemis-odb, and kotlin-stdlib-jdk8.

I posted it in another comment, but I am willing to record it when my time allows. It is quite baffling. I never encountered such slow compilation times even though I compiled some C++ projects before.

Re: Why Move from Gradle to Maven

#25
post #8

This is an oddly unconvincing little write-up. Firstly, learning gradle doesn't mean you are learning Maven simply because most dependencies use pom files for their metadata. I just means there's a little XML document embedded in your dependencies that 99% of developers never pay attention to, whether they're using Maven or ant or any other build tool. It's entirely irrelevant. Secondly, Gradle does not require you t…

I have used both and like maven better. I do not like the idea of using a turing complete language to define your builds. Every Gradle project I worked on eventually devolved into build code insanity.

Give me any maven project and I can figure out how to build it and modify dependencies and stuff within minutes.

With Gradle, it can be an hour of messing with code if the project maintainers got creative.

I've never had a project that maven, with it's mostly fixed build setup, couldn't handle. Having a turing complete build script is like turing complete cooking recipes. Pointless and definitely going to create more problems than it solves

Re: Why Move from Gradle to Maven

#26
post #2

Strange, gradle is just way faster in my use cases. Maven has always been a pain with regards to speed with handling dependencies.

If Gradle is fast in comparison to Maven, then I cannot begin to imagine how slow Maven is. A build system that has to spawn a daemon to speed up the process is a pretty shitty one. It takes about 2-3 minutes to do that for me, and still it takes 30 seconds to build my program which is not even that huge.

We have a 100k LoC project that builds in 15 seconds in maven and that includes packaging everything into an Uber jar.

Do you have a fast SSD? It makes an enormous difference in build times

Re: Why Move from Gradle to Maven

#28
Before Maven, there was Ant. Ant is a fancy Makefile written in XML that makes it very very easy to write build scripts that are not reproducible and rely on a particular structure and set of tools on the computer of the person that wrote the build file. At some point people realized the madness and wrote a new build tool that would only use declarative syntax, and would provide reproducible, contained build bliss. And lo and behold Maven came to be.

Later XML came into disfavor, as things do, and thus by association Maven as it uses XML. So they created Gradle, a tool deemed superior by the mere virtue of using a Groovy DSL instead of XML.

Here's my opinion about Gradle :

1 - the syntax is poor. Merely not using XML does not imply that it is fun to write Gradle build files. XML is verbose but very well specified so when you need to write some configuration it is a bit tedious but all in all very easy. On the other end Gradle uses a custom DSL that is poorly documented. Usually the best documentation there is are example files, so it can be very hard to figure out what to do in uncommon cases.

2 - plugins can extend the DSL. That means there is no single document to learn to know how to write Gradle build files, you also need to learn the DSL for the plugins you use. Maven developers went as far as specifying a standard plugin documentation format so that when you need to look for the syntax for a particular plugin you can do so fairly easily. Not so with Gradle, documentation quality is inconsistent and hard to find. The Android plugin seems especially bad in that regard.

3 - it killed the dream of declarative builds. Gradle allows to run Ant files directly and is simply Groovy under the hood so build scripts can quickly become ad hoc messes. Not what I call progress.

Re: Why Move from Gradle to Maven

#29
post #18

Earlier quoted context omitted.

Something is wrong with your setup methinks. Gradle daemon starts in a second or so for me on the two Java projects on this machine (around 20koc each) and like one second build times...

What could possibly be wrong with the setup though that would cause it? I have a couple of dependencies, including libGDX , artemis-odb , and kotlin-stdlib-jdk8 . I posted it in another comment, but I am willing to record it when my time allows. It is quite baffling. I never encountered such slow compilation times even though I compiled some C++ projects before.

One of my projects mentioned also uses libgdx. Have you tried the libgdx discord? The community is pretty helpful.

Re: Why Move from Gradle to Maven

#30

Earlier quoted context omitted.

If Gradle is fast in comparison to Maven, then I cannot begin to imagine how slow Maven is. A build system that has to spawn a daemon to speed up the process is a pretty shitty one. It takes about 2-3 minutes to do that for me, and still it takes 30 seconds to build my program which is not even that huge.

We have a 100k LoC project that builds in 15 seconds in maven and that includes packaging everything into an Uber jar. Do you have a fast SSD? It makes an enormous difference in build times

I have an old Western Digital Blue hard drive. My setup is really old. It is about >5 years old.
Post reply on HN