wiverson / 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.
Apache License 2.0
351 stars 53 forks source link

Question: Is this multimodule compatabile? #42

Closed Daniel-Yonkov closed 2 years ago

Daniel-Yonkov commented 2 years ago

Hello, I am considering using this template for building a demo application I am building on Java 16 using JavaFX as a separate UI module and a Logic as another.

@wiverson - Would you advice if this is a suitable approach to JVM integration using shader plugin and multimodule project?

Thank you for your time and effort on this template :+1:

wiverson commented 2 years ago

Off the cuff, I would say that if you want to build a JAR that has your logic and another JAR that has just your JavaFX ui-specific code with Maven multi-module, that would probably work fine. Effectively, you are just declaring that the UI code has an ordinary Maven dependency on the logic, and Maven multi-module is just helping with the build process a bit.

I would suggest avoiding using the shade plugin for JavaFX apps, as you really don't need it. JARs have a bit more complexity (e.g. service and manifest declarations, multi-version, module-info files, etc) that make shading less useful.

Just to make sure everything is as confusing as possible, there are Maven multi-module projects, and then there is the Java Module System. Very, very different things.