I use the Eclipse IDE as my daily driver for development. For a long time I have ignored the Java Platform Module System (JPMS) which was introduced in Java 9 and I’m still ignoring it today. If you want a proper module system simply use the better one that has existed for many, many years.

One point I’ve always put forward when arguing against the use of JPMS is that there is no way to create a simple project in Eclipse that uses the JPMS and has unit tests as part of the same project - much like the project setup that Maven uses. Only today I found out that this is indeed possible if you know how to configure your project and hack your way with the module system.

Let’s start by creating a plain Java project in Eclipse. Make sure you have a JDK configured that supports JPMS and create separate output folders for sources and class files. Eclipse new project wizard, first step

On the next page of the wizard make sure that “Create module-info.java” is checked.

Eclipse new project wizard, second step

When you hit Finish Eclipse will ask you for the module name of the project. Give your module a friendly name and start hacking away at your sources. Rather sooner than later you’ll get to the point where you want to add tests for your code. Add a new source folder that will contain your tests. Configure the source folder for your tests to generate its class files into a different folder and make sure you trigger Contains tests sources.

Eclipse new project wizard, second step

In the Libraries tab add the JUnit library to Classpath section, not to the Modulepath section. This hack enables the JUnit classes to be found for compiling and running the unit tests. But you’re not required to put the JUnit module into module-info.java, leaking the JUnit dependency out into the module path.

Kotlin multiline strings vs the $ character

12.06.2020 by Dirk Olmes

I recently started to use Kotlin for small projects at work. At first I was very pleased with the language but the more I use it the more I’m stubling over things that are not nice.

I’ll rumble about the braindead constructor syntax or the epic autoboxing fail …

read more

Generating test coverage for Sonar with maven, surefire and jacoco

11.05.2020 by Dirk Olmes

At work we’re using Sonar to keep our code quality under control. One integral part of code quality is test coverage and Sonar offers coverage metrics in the UI. However, the Sonar docs on code coverage are a bit sparse (at best) and don’t tell you the exact …

read more

Filtering spam mails with bogofilter

22.03.2020 by Dirk Olmes

I’m running a Postfix server here at home to process incoming mail. To integrate spam filtering I’m delivering mails via procmail - it’s as simple as setting mailbox_command = /usr/bin/procmail in postfix’ main.cf.

Spam filtering works by invoking the filter (bogofilter in my case) from procmail …

read more

Deploying files with maven-deploy-plugin

11.02.2019 by Dirk Olmes

We recently had an outage of our Nexus instance at work. The file system went corrupt, nexus would not start up properly complaining about a corrupted Orient DB.

The blob store was largely left intact. In hindsight I should have tried to rebuild the OrientDB from the blob store using …

read more

Fixing the dreaded “problem with defaults entries” in debian

29.09.2018 by Dirk Olmes

At work we host a number of Debian VMs. Most of them are integrated into the central active directory server using the sssd package.

Quite unrelatedly my boss kept nagging me about incoming emails to root that looked like this

Subject: *** SECURITY information for <host> ***

<host> : Sep 29 05:45 …
read more

Chromecasting using a custom Chromium build

23.01.2018 by Dirk Olmes

I’m using Gentoo as my Linux distro of choice. Gentoo compiles everything from source giving you a maximum flexibility - but that’s another story.

At work we’re traditionally an Apple shop - with some exceptions including me. We have an Apple TV device and a big TV screen in …

read more

Setting up a software RAID1

12.07.2017 by Dirk Olmes

I’m helping a friend to set up a machine with Gentoo. This will be a machine to host production applications and it is equipped with 2 identical hard drives. I will set up a software RAID 1. This has been a life saver on a similar machine before where …

read more

Genkernel with virtio drivers

06.04.2017 by Dirk Olmes

A colleague asked me to help analyze problems migrating a Gentoo guest VM from a Xen Server based host to a Proxmox (KVM based) host. The Gentoo VM would not boot beyond the initramfs - it just died saying that the root device could not be found.

Since the VM itself …

read more

SLF4J’s SimpleLogger

05.01.2017 by Dirk Olmes

I use the SLF4J API as the default logging facade in all my projects. SLF4J’s simple logger comes in handy when you don’t need a fully fledged logging framework. The SimpleLogger is despite its name quite configurable - if you know where to find the documentation: it’s in …

read more