How to specify the JNLP output file when using javafx-maven-plugin for creating a javafx native installer?

前端 未结 1 1742
后悔当初
后悔当初 2020-12-21 18:19

I\'m using the maven plugin https://github.com/javafx-maven-plugin/javafx-maven-plugin to generate an installer for the javafx application. I could create a exe and run it

相关标签:
1条回答
  • 2020-12-21 19:18

    For having JNLP-files being generated, you have to adjust your configuration a bit:

    <plugin>
        <groupId>com.zenjava</groupId>
        <artifactId>javafx-maven-plugin</artifactId>
        <version>8.2.0</version>
        <configuration>
            <mainClass>com.zenjava.test.Main</mainClass>
            <verbose>true</verbose>
            <appName>YourAwesomeProject</appName>
            <bundleArguments>
                <!-- to include "dtjava.js" and other related files, set this to TRUE -->
                <jnlp.includeDT>true</jnlp.includeDT>
    
                <!-- the JNLP-bundler needs this, they don't use "appName" for the filename ... you have to set this, otherwise it doesn't build -->
                <!-- for details of that JNLP-bundler, please have a look at the source -->
                <!-- https://github.com/Debian/openjfx/blob/e32fd960e20c58c9b7db27e426b4bca6d52add2f/modules/fxpackager/src/main/java/com/oracle/tools/packager/jnlp/JNLPBundler.java#L84 -->
                <jnlp.outfile>YourAwesomeProject</jnlp.outfile>
            </bundleArguments>
        </configuration>
    </plugin>
    

    You need to call mvn jfx:native instead of mvn jfx:web because Oracle is moving the JNLP-generation to a new internal form, removing some com.sun.*-packages.

    To only have the JNLP being generated, you could reduce build-time by specifying <bundler>jnlp</bundler> inside the configuration.

    Disclaimer: I'm the maintainer of that maven-plugin.

    0 讨论(0)
提交回复
热议问题