Squins IT Solutions

knowledge base

Java-productivity-development-tips

Written by Kees van Dieren

Some tips to be better productive as Java Developer.

Select correct jvm automatically

Select the correct JVM automatically with jEnv. This tool allows you to switch between different Java versions.

jenV for Windows is also available

Faster maven builds with parallel execution

Maven builds can be slow. Speed them up with parallel execution.

What can be done in parallel?

  • multiple modules: mvn -T 4 clean install will build 4 modules concurrently.
  • multiple tests within a module: mvn -T 4 -DforkCount=1 -DthreadCount=4 -Dparallel=classes will run 4 concurrently.

You can set these options in your MAVEN_ARGS environment variable, and set it in your .bashrc or .zshrc script:


# Faster Maven execution
#
# threadCount doesn't do anything on M1 Mac with arm java; forkCount does affect performance
# Most of our projects don't have many modules which can be build in parallel, so having 2 is enough for -T
export MAVEN_ARGS="-T 2 -DforkCount=4 -Dparallel=classes"

Verifying that it works can be done by veryfing build output contains Wall Clock.

Sequential build:

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  02:09 min
[INFO] Finished at: 2025-06-23T22:53:11+02:00
[INFO] ------------------------------------------------------------------------

Parallel build:


[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  01:44 min (Wall Clock)
[INFO] Finished at: 2025-06-23T22:55:35+02:00
[INFO] ------------------------------------------------------------------------

Posted in:  Java  Maven  Productivity 

CEO Squins, Kees

Kees van Dieren, CEO

We've years of experience helping startups and scale-ups to work more efficient by creating apps that are fit their needs.

Let’s talk. We look forward to exploring the opportunity to help your company too.

Go ahead and send us a message. We look forward to exploring the opportunity to help you too.