Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


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


Thank you!


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.


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.


That's why your builds are slow I guarantee it. Our build times dropped from ~4 minutes to ~20 seconds when they got everyone machines with SSD


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.


Yeah, this article is really not convincing. I've used both gradle and maven and IMO gradle is better in practically every way.


Is there a benefit to using either over MSBuild?


I assume if you are using MSBuild you're building .net or otherwise using visual studio. If you want to build these projects with gradle or maven you still have to invoke MSBuild in my experience. It's not strictly necessary AFAIK, but you'd be giving up a lot of what visual studio offers you for little in return.

In general, if you aren't already using a JVM language, there is not a whole lot of reason to use maven or gradle. Pretty much every language has equivalent native build tooling that you should be using instead.

If you are using a JVM language, even for part of your build process, then both can be used as the primary build tool and invoke the build tooling of the other ecosystems as needed. This is most useful when you have a native component that you are using from the JVM.

I have in the past used gradle to build the native C++ components for apps, but in general it reached out to msbuild on windows, and make files on linux.

I've used gradle it to invoke npm commands to build the frontend component of a WAR java webapp.


Or Make? CMake?


There's a maven daemon project now that closes most of the speed gap for my projects




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: