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.
- Browse slides of my 2024 talk Boosting Developer Productivity Through Better Modularity which uses this example
- Browse slides of my 2024 talk Combining Java Modules and Gradle for elegant project structures which is based on this sample
- Browse slides of my 2023 talk Modularizing Projects with the Java Module System and Gradle which gives more background on the modularity concepts in Java and Gradle
- Watch my YouTube playlist Understanding Gradle – Java Modularity for even more information on modularity in Java and how it is handled in Gradle
- 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
- Run
The example also builds on GitHub. The result can be explored here: https://github.com/jjohannes/java-module-system/actions