我在javafx项目中使用了这个插件:https://github.com/openjfx/javafx-maven-plugin,
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.4</version>
<configuration>
...
<launcher>launcher</launcher>
<mainClass>xxx/com.xxx.Main</mainClass>
</configuration>
</plugin>
我在代码中使用了java 14预览功能,并使用javafx:jlink
命令生成运行时映像。但当我运行Runtime映像CD_2。
如何在javafx-maven插件中使用javafx:jlink配置--enable-preview
更改javafx-maven插件的配置
<configuration>
...
<launcher>launcher</launcher>
<mainClass>xxx/com.xxx.Main</mainClass>
<options>
<option>--enable-preview</option>
</options>
</configuration>
注意:选项也添加到jlink图像脚本