java client maven,gluonhq-client-maven-plugin

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.

client-maven-plugin?label=Gluon%20Nexus&server=https%3A%2F%2Fnexus.gluonhq.com%2Fnexus

client-maven-plugin.svg?branch=master

license-BSD--3-%230778B9.svg

Getting started

To use the plugin, apply the following steps:

1. Apply the plugin

Edit your pom file and add the plugin:

com.gluonhq

client-maven-plugin

0.1.18

your.mainClass

gluon-releases

https://nexus.gluonhq.com/nexus/content/repositories/releases/

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

You can run the regular goals to build and run your project as a regular Java project on the JVM, if you use the javafx-maven-plugin plugin:

mvn clean javafx:run

Once the project is ready, the Client plugin has these main goals:

client:compile

This goal does the AOT compilation. It is a very intensive and lengthy task (several minutes, depending on your project and CPU), so it should be called only when the project is ready and runs fine on a VM.

Run:

mvn client:compile

The results will be available at target/client/gvm.

client:link

When the project is compiled for the target platform, this goal will generate the native executable.

Run:

mvn client:link

The results will be available at target/client/$targetPlatform/$AppName.

client:build

This goal simply combines client:compile and client:link.

client:run

Runs the executable in the target platform.

Run:

mvn client:run

Or run directly the application from command line:

target/client/$targetPlatform/$AppName/$AppName

It will create a distributable native application.

client:package

Create a package of the executable in the target platform.

Run:

mvn client:package

For instance, on iOS, this can be used to create an IPA.

Requirements

At this moment the plugin is in beta, and supports Linux, Mac OS X and iOS platforms for now.

To use the plugin to develop and deploy native applications on Mac or iOS platforms, you need a Mac with MacOS X 10.13.2 or superior, and Xcode 9.2 or superior, available from the Mac App Store. Once Xcode is downloaded and installed, open it and accept the license terms.

For now, only JDK 11 is supported. Any JDK 11 distribution that doesn't bundle JavaFX is valid, like:

Once downloaded and installed, set JAVA_HOME pointing to that JDK 11.

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值