JavaFX Maven Plugin

JavaFX Maven Plugin can be added to a Maven project by adding the plugin to its pom.xml file:

<plugins>
    <plugin>
        <groupId>org.openjfx</groupId>
        <artifactId>javafx-maven-plugin</artifactId>
        <version>0.0.4</version>
        <configuration>
            <mainClass>HelloFX</mainClass>
        </configuration>
    </plugin>
</plugins>

Add the necessary JavaFX dependencies:

<dependencies>
  <dependency>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-controls</artifactId>
    <version>14</version>
  </dependency>
</dependencies>

A sample project with the above configuration can be found in the samples repository.

Once the plugin and necessary dependencies are in place, the application can run via Maven using:

mvn javafx:run

Make sure to set the JAVA_HOME environment variable to correct JDK location.