Introduction
The JLink Maven Plugin lets you create a custom runtime image with the jlink tool introduced in Java 9.
The main idea is to avoid being tied to project artifacts and allow the user to fully control the process of creating an image. However, it is possible, of course, to customize the process using project artifacts.
Goals
This plugin has two goals:
-
jlink:jlink is not bound to any phase within the Maven lifecycle and is therefore is not automatically executed, therefore the required phase must be specified explicitly.
-
jlink:help display help information on the plugin.
To create a custom runtime image manually you need only to execute:
mvn jlink:jlink
It will not fork (spawn a parallel) an alternate build lifecycle and will execute the jlink goal immediately.
To display parameter details execute:
mvn jlink:help -Ddetail=true
Usage
General instructions on how to use the JLink Maven Plugin can be found on the usage page. Some more specific use cases are described in the examples given below.
In case you still have questions regarding the plugin's usage, please have a look at the FAQ.
If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our issue tracker. When creating a new issue, please provide a comprehensive description of your concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated.
Of course, patches are welcome, too. Contributors can check out the project from our source repository and will find supplementary information in the guide to helping with Maven.
Examples
To provide you with better understanding on some usages of the JLink Maven Plugin, you can take a look into the following examples: