jlink:jlink

Full name:

org.apache.maven.plugins:maven-jlink-plugin:3.0.0:jlink

Description:

The JLink goal is intended to create a Java Run Time Image file based on http://openjdk.java.net/jeps/282, http://openjdk.java.net/jeps/220.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: runtime.
  • Binds by default to the lifecycle phase: package.

Optional Parameters

Name Type Since Description
<addModules> List -

Usually this is not necessary, cause this is handled automatically by the given dependencies.

By using the --add-modules you can define the root modules to be resolved. The configuration in pom.xml file can look like this:

<addModules>
  <addModule>mod1</addModule>
  <addModule>first</addModule>
  .
  .
</addModules>
The command line equivalent for jlink is: --add-modules <mod>[,<mod>...].
<bindServices> boolean - Add the option --bind-services or not.
Default value is: false.
<compress> Integer - Here you can define the compression of the resources being used. The command line equivalent is: -c, --compress=level>. The valid values for the level are: 0, 1, 2.
<disablePlugin> String - You can disable a plugin by using this option. --disable-plugin pluginName.
<endian> String - The byte order of the generated Java Run Time image. --endian <little|big>. If the endian is not given the default is: native.
<ignoreSigningInformation> boolean - --ignore-signing-information
Default value is: false.
<includeLocales> List - Includes the list of locales where langtag is a BCP 47 language tag.

This option supports locale matching as defined in RFC 4647. Ensure that you add the module jdk.localedata when using this option.

The command line equivalent is: --include-locales=en,ja,*-IN.

<includeLocales>
  <includeLocale>en</includeLocale>
  <includeLocale>ja</includeLocale>
  <includeLocale>*-IN</includeLocale>
  .
  .
</includeLocales>

<jdkToolchain> Map -

Specify the requirements for this jdk toolchain. This overrules the toolchain selected by the maven-toolchain-plugin.

note: requires at least Maven 3.3.1
<launcher> String - Should the plugin generate a launcher script by means of jlink? The command line equivalent is: --launcher <name>=<module>[/<mainclass>]. The valid values for the level are: <name>=<module>[/<mainclass>].
<limitModules> List - Limit the universe of observable modules. The following gives an example of the configuration which can be used in the pom.xml file.
  <limitModules>
    <limitModule>mod1</limitModule>
    <limitModule>xyz</limitModule>
    .
    .
  </limitModules>
This configuration is the equivalent of the command line option: --limit-modules <mod>[,<mod>...]
<modulePaths> List - Include additional paths on the --module-path option. Project dependencies and JDK modules are automatically added.
<noHeaderFiles> boolean - This will suppress to have an includes directory in the resulting Java Run Time Image. The JLink command line equivalent is: --no-header-files
Default value is: false.
<noManPages> boolean - This will suppress to have the man directory in the resulting Java Run Time Image. The JLink command line equivalent is: --no-man-pages
Default value is: false.
<pluginModulePath> String - Define the plugin module path to be used. There can be defined multiple entries separated by either ; or :. The jlink command line equivalent is: --plugin-module-path <modulepath>
<sourceJdkModules> File - Set the JDK location to create a Java custom runtime image.
<stripDebug> boolean - This is intended to strip debug information out. The command line equivalent of jlink is: -G, --strip-debug strip debug information.
Default value is: false.
<suggestProviders> List - Suggest providers that implement the given service types from the module path.
<suggestProviders>
  <suggestProvider>name-a</suggestProvider>
  <suggestProvider>name-b</suggestProvider>
  .
  .
</suggestProviders>
The jlink command linke equivalent: --suggest-providers [<name>,...]
<verbose> boolean - This will turn on verbose mode. The jlink command line equivalent is: --verbose
Default value is: false.

Parameter Details

<addModules>

Usually this is not necessary, cause this is handled automatically by the given dependencies.

By using the --add-modules you can define the root modules to be resolved. The configuration in pom.xml file can look like this:

<addModules>
  <addModule>mod1</addModule>
  <addModule>first</addModule>
  .
  .
</addModules>
The command line equivalent for jlink is: --add-modules <mod>[,<mod>...].
  • Type: java.util.List
  • Required: No

<bindServices>

Add the option --bind-services or not.
  • Type: boolean
  • Required: No
  • Default: false

<compress>

Here you can define the compression of the resources being used. The command line equivalent is: -c, --compress=level>. The valid values for the level are: 0, 1, 2.
  • Type: java.lang.Integer
  • Required: No

<disablePlugin>

You can disable a plugin by using this option. --disable-plugin pluginName.
  • Type: java.lang.String
  • Required: No

<endian>

The byte order of the generated Java Run Time image. --endian <little|big>. If the endian is not given the default is: native.
  • Type: java.lang.String
  • Required: No

<ignoreSigningInformation>

--ignore-signing-information
  • Type: boolean
  • Required: No
  • Default: false

<includeLocales>

Includes the list of locales where langtag is a BCP 47 language tag.

This option supports locale matching as defined in RFC 4647. Ensure that you add the module jdk.localedata when using this option.

The command line equivalent is: --include-locales=en,ja,*-IN.

<includeLocales>
  <includeLocale>en</includeLocale>
  <includeLocale>ja</includeLocale>
  <includeLocale>*-IN</includeLocale>
  .
  .
</includeLocales>
  • Type: java.util.List
  • Required: No

<jdkToolchain>

Specify the requirements for this jdk toolchain. This overrules the toolchain selected by the maven-toolchain-plugin.

note: requires at least Maven 3.3.1
  • Type: java.util.Map
  • Required: No

<launcher>

Should the plugin generate a launcher script by means of jlink? The command line equivalent is: --launcher <name>=<module>[/<mainclass>]. The valid values for the level are: <name>=<module>[/<mainclass>].
  • Type: java.lang.String
  • Required: No

<limitModules>

Limit the universe of observable modules. The following gives an example of the configuration which can be used in the pom.xml file.
  <limitModules>
    <limitModule>mod1</limitModule>
    <limitModule>xyz</limitModule>
    .
    .
  </limitModules>
This configuration is the equivalent of the command line option: --limit-modules <mod>[,<mod>...]
  • Type: java.util.List
  • Required: No

<modulePaths>

Include additional paths on the --module-path option. Project dependencies and JDK modules are automatically added.
  • Type: java.util.List
  • Required: No

<noHeaderFiles>

This will suppress to have an includes directory in the resulting Java Run Time Image. The JLink command line equivalent is: --no-header-files
  • Type: boolean
  • Required: No
  • Default: false

<noManPages>

This will suppress to have the man directory in the resulting Java Run Time Image. The JLink command line equivalent is: --no-man-pages
  • Type: boolean
  • Required: No
  • Default: false

<pluginModulePath>

Define the plugin module path to be used. There can be defined multiple entries separated by either ; or :. The jlink command line equivalent is: --plugin-module-path <modulepath>
  • Type: java.lang.String
  • Required: No

<sourceJdkModules>

Set the JDK location to create a Java custom runtime image.
  • Type: java.io.File
  • Required: No

<stripDebug>

This is intended to strip debug information out. The command line equivalent of jlink is: -G, --strip-debug strip debug information.
  • Type: boolean
  • Required: No
  • Default: false

<suggestProviders>

Suggest providers that implement the given service types from the module path.
<suggestProviders>
  <suggestProvider>name-a</suggestProvider>
  <suggestProvider>name-b</suggestProvider>
  .
  .
</suggestProviders>
The jlink command linke equivalent: --suggest-providers [<name>,...]
  • Type: java.util.List
  • Required: No

<verbose>

This will turn on verbose mode. The jlink command line equivalent is: --verbose
  • Type: boolean
  • Required: No
  • Default: false