edvin / fxlauncher

Auto updating launcher for JavaFX Applications
Apache License 2.0
714 stars 110 forks source link

Headless Launcher config not working #106

Closed zemudkram closed 6 years ago

zemudkram commented 6 years ago

Hi,

I'm trying to set up a small Swing Application using a HeadlessLauncher. I've used the configuration as described in #73, adding the following to pom.xml after embed-manifest-in-launcher:

<execution>
    <id>configure-headless-launcher</id>
    <phase>package</phase>
    <goals>
        <goal>exec</goal>
    </goals>
    <configuration>
        <executable>jar</executable>
        <workingDirectory>${app.dir}</workingDirectory>
        <arguments>
            <argument>uef</argument>
            <argument>fxlauncher.HeadlessMainLauncher</argument>
            <argument>fxlauncher.jar</argument>
        </arguments>
    </configuration>
</execution>

However, it's not working when I issue a mvn clean package install, failing with the following messages:

[INFO] --- exec-maven-plugin:1.4.0:exec (installer) @ flaunchertest ---
No base JDK. Package will use system JRE.
The jar fxlauncher.jar has a main class fxlauncher.HeadlessMainLauncher that does not match the declared main fxlauncher.Launcher
No base JDK. Package will use system JRE.
The jar fxlauncher.jar has a main class fxlauncher.HeadlessMainLauncher that does not match the declared main fxlauncher.Launcher
The jar fxlauncher.jar has a main class fxlauncher.HeadlessMainLauncher that does not match the declared main fxlauncher.Launcher
Bundler Mac Application Image skipped because of a configuration problem: Main application jar is missing.  
Advice to fix: Make sure to use fx:jar task to create main application jar.
The jar fxlauncher.jar has a main class fxlauncher.HeadlessMainLauncher that does not match the declared main fxlauncher.Launcher
The jar fxlauncher.jar has a main class fxlauncher.HeadlessMainLauncher that does not match the declared main fxlauncher.Launcher
Bundler DMG Installer skipped because of a configuration problem: Main application jar is missing.  
Advice to fix: Make sure to use fx:jar task to create main application jar.
The jar fxlauncher.jar has a main class fxlauncher.HeadlessMainLauncher that does not match the declared main fxlauncher.Launcher
The jar fxlauncher.jar has a main class fxlauncher.HeadlessMainLauncher that does not match the declared main fxlauncher.Launcher
Bundler PKG Installer skipped because of a configuration problem: Main application jar is missing.  
Advice to fix: Make sure to use fx:jar task to create main application jar.
The jar fxlauncher.jar has a main class fxlauncher.HeadlessMainLauncher that does not match the declared main fxlauncher.Launcher
The jar fxlauncher.jar has a main class fxlauncher.HeadlessMainLauncher that does not match the declared main fxlauncher.Launcher
Bundler Mac App Store Ready Bundler skipped because of a configuration problem: Main application jar is missing.  
Advice to fix: Make sure to use fx:jar task to create main application jar.
The jar fxlauncher.jar has a main class fxlauncher.HeadlessMainLauncher that does not match the declared main fxlauncher.Launcher
[INFO] ------------------------------------------------------------------------

I'm using version 1.0.19 on MacOS, and the rest of the configuration is pretty much copied from the example Maven project. I'm assuming I've done something stupid, but I'm not quite sure what it is.

Thoughts?

zemudkram commented 6 years ago

To answer my own question, I also needed to update the appclass argument in the installer execution:

 <argument>-appclass</argument>
 <argument>fxlauncher.HeadlessMainLauncher</argument>