簡體   English   中英

使用javafx-maven-plugin創建Javafx本機安裝程序時,如何指定JNLP輸出文件?

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

我正在使用Maven插件https://github.com/javafx-maven-plugin/javafx-maven-plugin生成javafx應用程序的安裝程序。 我可以創建一個exe並成功運行它。 問題是我無法生成jnlp文件。 我看到以下訊息

[INFO] Skipping WebStart JNLP Bundler because of configuration error No OutFile Specificed
Advice to Fix: Please specify the name of the JNLP Outut file in 'jnlp.outfile'

我在哪里以及如何設置JNLP輸出文件的名稱?

為了生成JNLP文件,您必須稍微調整一下配置:

<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>

您需要調用mvn jfx:native而不是mvn jfx:web因為Oracle正在將JNLP代移到新的內部形式,從而刪除了一些com.sun。*-packages。

要僅生成JNLP,可以通過在配置內部指定<bundler>jnlp</bundler>來減少構建時間。

免責聲明:我是該Maven插件的維護者。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM