I have a (non-modular) JavaFX application that runs well from the command line, as I give to the command line the arguments --module-path and --add-modules to include the javafx modules (in my case, I use
--module-path /home/user/libs/javafx_libs --add-modules javafx.controls,javafx.fxml,javafx.web
This works fine, because I know where I had manually installed my javafx files (i.e. in /home/user/libs/javafx_libs).
However, I now want to build it, but
- not using some manual extraction directory location, but using maven dependencies, and
- in one single application jarfile without any platform-specific dependencies.
So my maven dependencies look like :
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${version.javafx}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${version.javafx}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-web</artifactId>
<version>${version.javafx}</version>
</dependency>
As far as I understand, I have to make my complete application modular, which is (another) new thing to me, but the first basic steps have been completed (added a module-info.java file, and added it's "requires"- statements). I want to build this application so that I can start it without these module paths and module additions.
My questions are:
- Where can I then find the location of Maven's repository's JavaFX files,
- How can I build this in one single jar file, and
- How is such a build done in Maven? That is, which plugins do I need to build it this way, and how do I configure these plugins in Maven?
I may also be helped by getting a link to some good book (or to some other publication) where this is explained.