Our great sponsors
-
maven-jpackage-template
Sample project illustrating building nice, small cross-platform JavaFX or Swing desktop apps with native installers while still using the standard Maven dependency system.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
jtoolprovider-plugin
This Maven Plugin does two things. First, it automatically transforms your Maven dependency graph into Java modules. Second, it bridges Maven and built-in Java tools like jdeps, jlink, and jpackage.
I kind of need this stuff to make it easier to build nice small jpackage installer packages. I have a workaround template project right now that works pretty well, but the user has to manually add modules. If I add a plugin that parsed the Maven dependency tree to find modules it would "just work" for module declarations without having to tweak the pom.xml.
In this case, you probably will need to use https://github.com/moditect/moditect-gradle-plugin to add the module-info to the dependencies. While they are automatic modules you cannot make a module require an explicit library. Using the moditect plugin you can add the module-info to other jars and add the explicit requires.
github.com/moditect/layrry
You can use the https://github.com/moditect/moditect maven plugin to add the module-info to the third-party jars
There are plugins coming along that help out, e.g. the moditect stuff and the jtoolprovider plugin I wrote (bridges Maven and jdeps/jlink/jpackage/etc).
I'm aware of the consequences. I have added module-info to our servlet container, https://github.com/piranhacloud/piranha/, and we use a lot of external dependencies. And most of them aren't modules but it works ;)
Related posts
- New tool for packaging JVM apps, an alternative to jpackage
- Building a layered modular Java application? Watch out for these!
- Jtoolprovider-Plugin: Maven Plugin for JavaFX
- Need help building JavaFX project in VsCode
- How do you usually deploy Java Swing application in Windows machine, so that it can pass Microsoft Defender SmartScreen checking?