Java Module System (with Gradle)

February 25, 2025 ยท View on GitHub

This is a minimalistic project that shows a structured Java project setup utilising the Java Module System (JPMS) to define a modular software structure with Gradle as the underlying build system. To integrate these, the GradleX Java development plugins are used.

With this setup, modularization and other build configuration concerns are separated. With that accidental complexity in the module setup is avoided.

Learn more

In action: projects that use this setup

Build the example

  • Run ./gradlew check to run tests and check integrity of the module setup
  • To build a self-contained installable of the application, run:
    • Run ./gradlew assembleWindows-2022
    • Run ./gradlew assembleMacos-13
    • Run ./gradlew assembleMacos-14
    • Run ./gradlew assembleUbuntu-22.04

The example also builds on GitHub. The result can be explored here: https://github.com/jjohannes/java-module-system/actions