13 September 2025
Speed-up and secure your Maven builds with Maven Daemon
You can speed-up Maven builds considerably by using Maven Daemon.
Here is how I installed it on Ubuntu Linux:
Make sure you have a Java Development Kit installed.
Set the JAVA_HOME environment variable to point to your JDK by creating a file /etc/profile.d/java.sh with this content:
#!/bin/sh export JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64 Download Maven Daemon.
Unpack it into /opt
Make it available in PATH:
$ cd /usr/bin $ sudo ln -s ../../opt/maven-mvnd-1.0.2-linux-amd64/bin/mvnd . $ sudo ln -s mvnd mvn You can configure IntelliJ IDEA to use it by setting Maven home path to /opt/maven-mvnd-1.
30 July 2019
How to run exec-maven-plugin only if a file is not up-to-date
In my Maven build, I use exec-maven-plugin to run an external tool for Java code generation. In this case the flatbuffers compiler (flatc).
By default, flatc always runs, so you always get a new .java file. This will always trigger Java compiler to run, which will in turn always trigger jar packaging to run, etc. I would like flatc to only run if it’s source file is updated, so I can get a properly incremental build and avoid needlessly recompiling.