Skip to content
Maven plugin to run JavaFX 11+ applications
Branch: master
Clone or download
jperedadnr Merge pull request #12 from jperedadnr/master
Use Java Home, refactoring and other issues
Latest commit 76b6ecb Apr 23, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src #11 Use Java_Home Apr 18, 2019
.gitignore First commit Feb 28, 2019
LICENSE Initial commit Feb 28, 2019
README.md #8 Update readme Apr 19, 2019
pom.xml #8 Add source, target and release parameters Apr 18, 2019

README.md

Maven plugin for JavaFX

Maven plugin to run JavaFX 11+ applications

Maven Central Apache License

Install

Clone the project, set JDK 11 and run

mvn install

Usage

Create a new Maven project, use an existing one like HelloFX, or use an archetype.

The project can be modular or non-modular.

JavaFX dependencies are added as usual:

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

Add the plugin:

<plugin>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-maven-plugin</artifactId>
    <version>0.0.1</version>
    <configuration>
        <mainClass>org.openjfx.App</mainClass>
    </configuration>
</plugin>

To compile the project (optional):

mvn javafx:compile

To run the project:

mvn javafx:run

Optional arguments:

The plugin includes by default: --module-path, --add-modules and -classpath.

Optionally, other VM arguments and runtime arguments can be set:

<plugin>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-maven-plugin</artifactId>
    <version>0.0.1</version>
    <configuration>
        <mainClass>org.openjfx.hellofx/org.openjfx.App</mainClass>
        <options>
            <option>--add-opens</option>
            <option>java.base/java.lang=org.openjfx.hellofx</option>
        </options>
        <commandlineArgs>-Xmx1024m</commandlineArgs>
    </configuration>
</plugin>

Optionally, when compiling with javafx:compile, the source level, target level and/or the release level for the Java compiler can be set:

<plugin>
    <groupId>org.openjfx</groupId>
    <artifactId>javafx-maven-plugin</artifactId>
    <version>0.0.1</version>
    <configuration>
        <source>12</source>
        <target>12</target>
        <release>12</release>
        <mainClass>org.openjfx.hellofx/org.openjfx.App</mainClass>
    </configuration>
</plugin>
You can’t perform that action at this time.