简体   繁体   English

使用javafx-maven-plugin创建Javafx本机安装程序时,如何指定JNLP输出文件?

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

I'm using the maven plugin https://github.com/javafx-maven-plugin/javafx-maven-plugin to generate an installer for the javafx application. 我正在使用Maven插件https://github.com/javafx-maven-plugin/javafx-maven-plugin生成javafx应用程序的安装程序。 I could create a exe and run it successfully. 我可以创建一个exe并成功运行它。 the problem is I'm not able to generate the jnlp file. 问题是我无法生成jnlp文件。 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'

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: 为了生成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>

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. 您需要调用mvn jfx:native而不是mvn jfx:web因为Oracle正在将JNLP代移到新的内部形式,从而删除了一些com.sun。*-packages。

To only have the JNLP being generated, you could reduce build-time by specifying <bundler>jnlp</bundler> inside the configuration. 要仅生成JNLP,可以通过在配置内部指定<bundler>jnlp</bundler>来减少构建时间。

Disclaimer: I'm the maintainer of that maven-plugin. 免责声明:我是该Maven插件的维护者。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用没有JRE的javafx-maven-plugin Maven + Build Native - Maven + Build Native with javafx-maven-plugin without JRE 如何将许可证添加到由javafx-maven-plugin创建的exe安装程序? - How can I add a license to an exe-installer created by javafx-maven-plugin? 带有CDI,JPA和javafx-maven-plugin的JavaFX - JavaFX with CDI, JPA and javafx-maven-plugin 如何结合javafx-maven-plugin和maven-assembly-plugin? - How to combine javafx-maven-plugin and maven-assembly-plugin? Linux可执行文件使用javafx-maven-plugin失败 - Linux executable fails using javafx-maven-plugin 如何使用 javafx-maven-plugin 运行包含 jfoenix 的 maven java fx 项目 - How to run a maven java fx project that includes jfoenix using javafx-maven-plugin javafx-maven-plugin mac pkg安装程序未显示应用程序图标 - javafx-maven-plugin mac pkg installer does not show app icon 为什么 javafx-maven-plugin:jlink 会导致 java.nio.file.AccessDeniedException? - Why does javafx-maven-plugin:jlink cause a java.nio.file.AccessDeniedException? JavaFX + Maven + javafx-maven-plugin:条目[从领域导入ClassRealm [maven.api,parent:null]] - JavaFX + Maven + javafx-maven-plugin: Entry[import from realm ClassRealm[maven.api, parent: null]] Maven 编译错误:包 javafx 不存在(使用 javafx-maven-plugin) - Maven Compilation Error: package javafx does not exist (with javafx-maven-plugin)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM