Live data from Hacker News

Why Move from Gradle to Maven

blog.astradot.com

31–40 of 44 posts

Re: Why Move from Gradle to Maven

#31
post #29

Earlier quoted context omitted.

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.

It is not my codebase, I had to clean it up. I managed to do it though and it basically looks like every other libGDX project. I can even create a single JAR file that works! I am pretty happy about that. Everything is up to date, and I am converting the codebase from Java to Kotlin. Still a long way to go, but we (my partner and I) will get there. :)

By the way: I also use `googleJavaFormat` and `ktlint` to format both Java and Kotlin files. I also pack textures before running the game.

In any case, my old hardware may be at fault here, or the fact that I also run multiple things in the background, or that I run a couple of Gradle tasks, or a combination of these things.

Re: Why Move from Gradle to Maven

#32
post #17

Earlier quoted context omitted.

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. :/

That's been my experience of Gradle too. It's always been slower than Maven for me. In any case, 90% of build time is unit tests for the projects I've worked on, so switching tools offer minimal benefit in that regard.

Re: Why Move from Gradle to Maven

#33
What I don't get is the exception: this could be handled with a custom maven plugin (as an extreme way) or a wedge of inline script in the pom.xml (sloppy and maybe not so portable). Or the Assembly plugin. There's countless ways to build custom jars.

Re: Why Move from Gradle to Maven

#34
post #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. A…

I like XML. It tells me when I've forgotten a value, like 'version'. I still don't get why people rail against a machine-and-human-readable format that isn't space-sensitive, can be easily validated, and can be processed by virtually any language. Sure it's verbose, but it's also robust.

Re: Why Move from Gradle to Maven

#35
Has Gradle finally got an equivalent to parent pom? It's such a vital feature, to be able to set dependency versions and plugins up to use on all child projects and publish into a repo. Last time I looked, Gradle couldn't do this.

Re: Why Move from Gradle to Maven

#36
post #5

super short post, on a topic that seems not super relevant to many. but i dig it. i dig it a lot. languages are a pain in the butt. you can do anything with languages. so can everyone else using the language. it's actually quite nice having constraints. having a uniform model, having dead inert data. everyone using the same machine, the same mechanisms. maven's lifecycle[1], the steps of a build, being well defined,…

Yeah, I'm a big fan of Groovy (and Kotlin, though I know it less), but what bugs me about Gradle is, at least when I last used it which to be fair is some years, is that it solves 50% out of the box. Maven was closer to 85%. The Gradle manual started with, "here's how you write your own tasks!" I don't want to write my own; I want to know how if I need to, but you're saying I need to right off the bat. Maybe that was…

To make it worse, every Gradle project I've come across has different solutions for the same common tasks. With Maven it's more-or-less standardised, because custom plugins are rare (I've come across just one in 20 years, and I wrote it for a special purpose). Embedded Ant was more common, but thankfully rare now. Everyone just uses the same handful of plugins in my experience.

Agree that Groovy is awesome.... as a compliment to Java. I'd learn to dislike it quickly though if I had to write an entire project with it.

Re: Why Move from Gradle to Maven

#37
I love the simplicity of Maven and declarative build tools vs imperative.

The problem is Maven has a huge legacy code base and sees very little improvement.

Its ability to concurrently build modules is flawed and it doesn't have incremental compilation support.

There is an opportunity to build a new Maven (Maven 4) from scratch with some newer principles but adhering to most of the XML format.

Btw Maven can now read POM file in other languages than XML like Groovy & Kotlin

Re: Why Move from Gradle to Maven

#38
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.

Nit: you don't need to specify kotlin stdlib since Kotlin 1.4

Re: Why Move from Gradle to Maven

#40
There are some claims that Gradle builds way faster than maven. I personally witnessed at my last job (usual Spring Boot, Hibernate stack), that the builds were indeed way faster after migrating to Gradle, but then the Maven configuration had quite some years behind it, so it could also be possible that it was not setup optimal.

Anyone has some experience with that?

Post reply on HN