Eclipse中使用Maven的JavaFX应用程序 [英] JavaFX Application with Maven in Eclipse

查看:640
本文介绍了Eclipse中使用Maven的JavaFX应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想问一下是否有任何方法可以将JavaFX添加到Eclipse中的Maven Archetype列表或任何使用Maven构建JavaFX Application的插件中。

I want to ask if there is any method to add JavaFX into Maven Archetype list in Eclipse or any plugin to use Maven to build JavaFX Application.

推荐答案

javafx-maven-plugin 可用于maven。

There is the javafx-maven-plugin which is available for maven.

使用Java 8进行开发时,您只需将该插件作为一些build-plugin,而无需进一步依赖。

When developing with Java 8 you just put that plugin as some build-plugin, without further dependencies.

<plugin>
    <groupId>com.zenjava</groupId>
    <artifactId>javafx-maven-plugin</artifactId>
    <version>8.8.3</version>
    <configuration>
        <mainClass>your.main.class.which.extends.javafx.Application</mainClass>
    </configuration>
</plugin>

调用 mvn jfx:jar 创建你的javafx -application-jar在 target / jfx / app / yourapp-jfx.jar 中,甚至在调用 mvn时创建本机启动程序(如EXE文件) jfx:native

Calling mvn jfx:jar creates your javafx-application-jar inside target/jfx/app/yourapp-jfx.jar, or even creates native launcher (like EXE-file) when calling mvn jfx:native.

免责声明:我是javafx-maven-plugin的维护者。

Disclaimer: I'm the maintainer of the javafx-maven-plugin.

这篇关于Eclipse中使用Maven的JavaFX应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆