使用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文件。
我看到以下消息
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 successfully. the problem is I'm not able to generate the jnlp file. I see the below message
[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输出文件的名称?
Where and how to do I set the name of the JNLP output file ?
推荐答案
为了生成JNLP文件,你必须稍微调整一下你的配置:
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>
您需要致电 mvn jfx:native
而不是 mvn jfx:web
因为Oracle正在将JNLP生成移动到新的内部形式,删除了一些com.sun。* - 包。
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.
要仅生成JNLP,您可以通过在配置中指定< bundler> jnlp< / bundler>
来减少构建时间。
To only have the JNLP being generated, you could reduce build-time by specifying <bundler>jnlp</bundler>
inside the configuration.
免责声明:我是该maven插件的维护者。
Disclaimer: I'm the maintainer of that maven-plugin.
这篇关于使用javafx-maven-plugin创建javafx本机安装程序时如何指定JNLP输出文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!