【发布时间】:2026-01-12 01:05:02
【问题描述】:
在我们的项目中,我们使用Maven plugin javafx-maven-plugin 为我们的JavaFX 应用程序创建一个本机可执行文件。我们的配置如下所示:
<plugin>
<groupId>com.zenjava</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>8.8.3</version>
<configuration>
<vendor>our company</vendor>
<mainClass>foo.bar.MainClass</mainClass>
</configuration>
</plugin>
运行 ``mvn jfx:native'' 后,一个可执行的 EXE 文件被成功创建。该可执行文件没有我们想要的安装程序例程。但是,构建日志警告我们不要使用安装程序构建器:
[INFO] Skipping 'EXE Installer' because of configuration error 'Can not find Inno Setup Compiler (iscc.exe).'
Advice to fix: Download Inno Setup 5 or later from http://www.jrsoftware.org and add it to the PATH.
[INFO] Skipping 'MSI Installer' because of configuration error 'Can not find WiX tools (light.exe, candle.exe).'
Advice to fix: Download WiX 3.0 or later from http://wix.sf.net and add it to the PATH.
有没有办法告诉插件我们明确不希望创建安装程序来避免这些警告?
这些警告不是什么大问题,但我们会尽量让我们的项目保持干净。
更新一:为了在maven打包阶段创建可执行文件,我添加了如下配置(由http://javafx-maven-plugin.github.io提议):
<executions>
<execution>
<!-- required before build-native -->
<id>create-jfxjar</id>
<phase>package</phase>
<goals>
<goal>build-jar</goal>
</goals>
</execution>
<execution>
<id>create-native</id>
<phase>package</phase>
<goals>
<goal>build-native</goal>
</goals>
</execution>
</executions>
【问题讨论】:
标签: windows javafx executable