Ant Maven Gradle build

My final take on Gradle (vs. Maven)

I tweet technical content that I consider interesting, but the funny tweets are the ones that get the most engagement. I attended the JavaLand conference in March, stumbled upon the Gradle booth, and found this gem: Things have changed a lot 😂😂😂“When you can’t beat them, join them” pic.twitter.com/SnX3KN57o8— Nicolas Frankel 🇺🇦🇬🇪 (@nicolas_frankel) March 22, 2023 Of course, at some point, a fanboy hijacked the thread and claimed the so-called superiority of Gradle. In this post, I̵

Maven build performance Maven daemon Docker buildkit

Faster Maven builds in Docker

Last week, I described different techniques to fasten your Maven builds. Today, I’d like to widen the scope and do the same for Maven builds inside Docker. Between each run, we change the source code by adding a single blank line; between each section, we remove all built images, including the intermediate ones that are the results of the multi-stage build. The idea is to avoid reusing a previously built image. Baseline To compute a helpful baseline, we need a sample project. I create

Maven build performance Maven daemon Surefire

Faster Maven builds

Builds require a few properties, chief among them reproducibility. I would consider speed to be low on the order of priorities. However, it’s also one of the most limiting factors to your release cycle: if your build takes T, you cannot release faster than each T. Hence, you’ll probably want to speed up your builds after you’ve reached a certain maturity level to enable more frequent releases. I want to detail some techniques you can leverage to make your Maven builds faster i

JAR Assembly Shade Spring Boot Maven

Creating self-contained executable JARs

When your application goes beyond a dozen of lines of code, you should probably split the code into multiple classes. At this point, the question is how to distribute them. In Java, the classical format is the Java ARchive, better known as the JAR. But real-world applications probably depend on other JARs. This post aims to describe ways to create self-contained executable JARs, also known as uber-JARs or fat JARs. What is an executable JAR? A JAR is just a collection of class files. To be

Maven logging Log4J2 SLF4J Spring Boot

Feedback on the Log4J2 hack in Spring Boot

Last week, I wrote a post that described how to hack the Maven dependency resolution system. I admit it was a dirty hack, it’s even in the post name. But I got it wrong. Thanks Stéphane Nicoll for pointing it out: "It boils down to excluding the spring-boot-starter-logging in every Spring Boot starter"Since you've put every in bold, I assume you meant it. That's actually wrong and not what the documentation states.Here is an example: https://t.co/JKgPXCh0Nb— Stéph

Maven hack logging Log4J2 SLF4J Spring Boot

A dirty hack to ease the usage of Log4J2 in Spring Boot

Logging is one of the fundamental components of any application which runs in production. Yet, between performance and logging in critical environments, I’d favor the former. For that reason, modern logging frameworks should implement at least two requirements: Async appenders: the write operation shouldn’t be blocking the execution of the programLazy computation: the framework doesn’t run expensive computations until they are needed - or never if that’s the case. The fi

GitHub Actions Continuous Integration Maven release management

GitHub Actions and Maven releases

I like GitLab a lot. Yet, there’s no denying that GitHub has become the de facto standard to host Open Source projects. With GitHub Actions, it’s now possible to implement entire Continuous Integration pipelines without leaving GitHub. In this post, I’d like to highlight how to release Maven artifacts using GitHub Actions. Maven prerequisites Before creating the CI pipeline - and running it, it’s necessary to configure the underlying Maven project. A quick Maven pr

Spring DevTools Maven Jib IntelliJ IDEA tip

Spring DevTools with Jib and IntelliJ IDEA

I’ve been recently developing a Spring Boot application, and to speed up my development speed, I added Developer Tools as a dependency. By default, classes loaded in the HotSpot JVM can be updated only if the later runs in debug mode, and only for changes regarding method implementation. This means adding an attribute to an class requires a full restart. DevTools is an improvement over that. It works by tweaking the standard classloading mechanism: one classloader is dedicated to librar