openjfx / javafx-maven-plugin

Maven plugin to run JavaFX 11+ applications
Apache License 2.0
371 stars 59 forks source link

Support for maven-shade-plugin and launch4j-maven-plugin #42

Open ssy-lehmann opened 5 years ago

ssy-lehmann commented 5 years ago

Hi,

If you take a look at https://github.com/StegmannSystems/javafx.demo you can see that your mechanism mvnw clean javafx:run works fine. However that's just interesting for the purpose of testing.

See the following problem:

C:\Checkouts\javafx.demo>java -jar target\javafx-demo-0.0.1-SNAPSHOT-shaded.jar
Error: JavaFX runtime components are missing, and are required to run this application

I can solve it like this:

C:\Checkouts\javafx.demo>java --module-path c:\tools\javafx-sdk-11.0.2\lib  --add-modules=javafx.controls,javafx.fxml,javafx.web,javafx.media -jar target\javafx-demo-0.0.1-SNAPSHOT-shaded.jar

The main point here is that I already fetched all Java FX dependencies via pom.xml and I shouldn't be forced to specify those two parameters (at least not the module path). Do you have any clever trick on how this can be done more comfortable for maven-shade-plugin and launch4j (at least javafx:run seems to know)?

commi commented 3 years ago

Late answer but i had a similar problem, that i could solve by using a Main-class that did not extend Application, so hat no direct JavaFX-dependencies. This just called App::main(), which did extend Application. This works for some reason.