Faster Maven Builds
blog.frankel.ch
blog.frankel.ch
However, it requires designing your tests such you can do this. One key trick is using randomized data and test fixtures. Another one is avoiding the overhead of initializing databases, etc. over and over again. Of course, all that stuff is useful in just about any language. But some languages make this easier than others.
Another nasty one I encountered a couple years ago: After switching the build servers to using ramdisks, the app started breaking in subtle ways. Turns out there were two conflicting dependencies, but building on a server using ext4 and with the specific number of concurrent threads caused the "right" one to appear first the .jar's central directory.
Gotta add filesystem directory entry ordering to the list too.
Next is how to make maven cache work more reliably and aggressively, as maven is still too slow at incremental build: A zero-change build can take seconds, while Bazel finishes almost instantly.
But when configured properly, it actually has parallel builds, with fine-grained build dependencies, so only the actually changed classes will be recompiled.
Android is probably the only platform whose conferences to this day have a sessions about improving build times, thanks Gradle.
When doing Windows CE, Pocket PC, Windows Phone 7, WinRT, Symbian, iOS, I never needed a gaming rig as development workstation.
The problem is the amount of dependencies/build tasks, not the tool managing those.
Thankfully outside Android, I never have to put up with it on regular Java projects.
Yeah, it is very fast, when one has all the knobs to help Gradle pretend it is fast.
I have been setting up Java CI/CD pipelines since 2005, have used all major CI/CD products in the Java world, including your beloved "blazing fast" Gradle.
Even a Linux VM running on top of the same Windows will probably be faster.
(I have not tested exactly that but I have tested in dual boot configuration and I have tested .Net cli apps and seen them running faster under a Linux VM on top of Windows than it did natively on Windows.)
It's already a clusterfuck in JS land with grunt/gulp/webpack/TSC/rollup/parcel/snowpack/esbuild/rome etc, do not bring that madness to java as well.
maven is at the level of maturity where you don't need to even refer to it by it's version - it's just maven now (there's been two previous incarnations of maven, called maven 1 and maven 2). Then there's ANT, and there's a bunch of bespoke tools as well that i'm not too familiar with - ANT is still useful, but i would say that it plugins into the maven toolchain acceptably OK.
I feel the opposite. For 99% of use cases, a plain maven pom file works. If you need something custom, you should think hard about why the existing workflow doesn't fit you before moving on. I think maven mostly gets hate from hip developers because it uses xml, but the tool itself works fine.
I've spent ages more getting simple js apps to build correctly. It "just works" in java, and has for ages (thus archaic).
They are complicated because they do a fuckton of things. Please don't give me another proof-of-concept build system which then turns out to do 5% of what I needa and have no plugins available.
Gradle is fine, just use it. It's not the best. It's OK. If you hate it, use Maven. It's also OK. Just copy-paste some answers off stackoverflow and move on... we'll all be better off.
I recently found out that I can just use Github cli to clone from upstream, and add one line in my game's Gradle build file to tell Gradle to use the cloned folder instead of looking at local cache. In Gradle world it is known as Composite build and, it has really make me like Gradle despite their convoluted build files.
If your build has really custom stuff, and you cannot fit your custom work into those phases (e.g., it interferes with some other custom stuff), then you have a maven problem that's hard to solve. One usually resolve this by writing a maven plugin, and that kinda sucks. But hey, at least if you do it, you can contribute this to the whole plugin ecosystem and thus, improve it for somebody else.
IME the benefits of fixed phases outweigh the costs: any developer can pick up any maven project and immediately know how to build it, how to run the tests, and so on. A lot of other build systems are really bad for knowing where to start; allowing arbitrary task names and arbitrary relationships between what runs when just ends up with projects having pointless differences between what they call things - do I need to run "gradle build", "gradle install", or what? (and similarly for sbt etc.)
That's the biggest problem. Nearly every developer thinks their build has *really* custom stuff whereas it's wrong in 99% of the cases.
Then comes Gradle with its so-much-vaunted flexibility and deliver you exactly what you think you need. And who is going to maintain the clusterfuck of spaghetti code that your build has become?