Gluon Client plugin for Maven

The Gluon Client plugin for maven projects leverages GraalVM, OpenJDK and JavaFX 11+, by compiling into native code the Java Client application and all its required dependencies, so it can directly be executed as a native application on the target platform.

Maven Central Travis CI BSD-3 license

Requirements

Mac OS X and iOS

Additional requirements

Linux and Android

Additional requirements

The client plugin will download the Android SDK and install the required packages.

Alternatively, you can define a custom location to the Android SDK by setting the ANDROID_SDK environment variable, making sure that you have installed all the packages from the following list:

Windows

Getting started

To use the plugin, apply the following steps:

1. Apply the plugin

Edit your pom file and add the plugin:

<plugin>
    <groupId>com.gluonhq</groupId>
    <artifactId>client-maven-plugin</artifactId>
    <version>0.1.27</version>
    <configuration>
        <mainClass>your.mainClass</mainClass>
    </configuration>
</plugin>

The plugin allows some options that can be set in configuration, to modify the default settings, and several goals, to build and run the native application.

2. Goals

Desktop

The following goals apply to Linux, Mac OS X and Windows.

To build the native image:

mvn clean client:build

To run the native image:

mvn client:run

or simply run the native executable found in target/client.

iOS

Set the target to ios (for iOS devices) in the pom.xml:

<artifactId>client-maven-plugin</artifactId>
<configuration>
    <target>ios</target>
    <mainClass>${mainClassName}</mainClass>
</configuration>

Build the native image:

mvn clean client:build

Note: Since all java bytecode is translated to native code, the compilation step can take a long time, and it requires a fair amount of memory.

Run the app on the connected iOS device:

mvn client:run

Or package and create an IPA file to submit to TestFlight or to the App Store:

mvn client:package

Note: In order to deploy apps to an iOS device, you need a valid iOS provisioning profile, as explained in the documentation.

Android

Set the target to android (for android devices) in pom.xml:

<artifactId>client-maven-plugin</artifactId>
<configuration>
    <target>android</target>
    <mainClass>${mainClassName}</mainClass>
</configuration>

Build the native image:

mvn clean client:build

Note: Since all java bytecode is translated to native code, the compilation step can take a long time, and it requires a fair amount of memory.

Package and create an APK file:

mvn client:package

Install the APK file on a connected Android device:

mvn client:install

Run the installed app on the connected Android device:

mvn client:run

Documentation and samples

Check the documentation for more details about the plugin and running the maven samples.

Issues and Contributions

Issues can be reported to the Issue tracker

Contributions can be submitted via Pull requests, providing you have signed the Gluon Individual Contributor License Agreement (CLA) (See What is a CLA and why do I care in case of doubt).