tentackle-jlink:init

Full name:

org.tentackle:tentackle-jlink-maven-plugin:21.16.1.0:init

Description:

Initializes the templates.
Copies the default templates to the project's template directory.

Attributes:

  • Requires a Maven project to be executed.
  • Executes as an aggregator goal.
  • The goal is not marked as thread-safe and thus does not support parallel builds.

Required Parameters

Name Type Since Description
<imageDirectory> File - The directory created by jlink holding the image.
Default: ${project.build.directory}/jlink
<mainClass> String - The name of the main class.
<variablesPrecedence> String - Defines the precedence of properties and variables.
By default, system properties are overridden by maven properties which are overridden by the extra template variables.

The case-insensitive keywords are:

  • system, sys: for system properties
  • maven, mvn, properties, props, pom: maven properties
  • variables, vars, var, extras, extra, template: extra template variables

Default: system, maven, variables

Optional Parameters

Name Type Since Description
<addModules> List<String> - Extra jre or jdk modules to add to the image.
Useful to add the runtime localization module or extra tools in bin.

Example:

<addModules>
  <addModule>jdk.localedata</addModule>
  <addModule>jdk.jcmd</addModule>
</addModules>
<charset> String - The encoding to read and write files.
Default: ${project.build.sourceEncoding}
<classpathDependencies> List<ClasspathDependency> - Dependencies that should go to the classpath instead of modulepath.
<compress> Integer - Compression of resources.
Corresponds to the jlink option --compress.
<copyAll> boolean - Controls whether all or only already installed templates should be copied.
By default, all templates are copied to the project's template folder.
Otherwise, only those templates that already exist in the template folder will be overwritten.
Default: true
<excludeModules> List<String> - Modules to exclude.
Necessary only if a dependency refers to removed api even if not used at all at runtime.
<excludeModules>
  <excludeModule>jdk8internals</excludeModule>
</excludeModules>
<extraClassifier> String - Additional classifier to add to deployed artifacts.
<extraClasspathElements> List<String> - Extra classpath elements.
Pathnames are relative to the image root.
<extraDirectories> List<File> - Extra directories to copy to the image.
<ignoreSigningInformation> boolean - Suppresses a fatal error when signed modular JARs are linked in the runtime image.
Corresponds to the jlink option --ignore-signing-information
Default: false
<jdepsTool> File - Explicit path to the jdeps tool.
Only if toolchains cannot be used.
See also: org.tentackle.maven.AbstractTentackleMojo.getToolchain()
User Property: jdepsTool
<jdkToolchain> Map<String,String> - Toolchain for invocation of external tools.
Explicitly specifies the "jdk" toolchain for this plugin only. Overrides the toolchain selected by the maven-toolchain-plugin, if any.

Example:

  <jdkToolchain>
    <version>14</version>
  </jdkToolchain>
To deselect the toolchain configured by the maven-toolchain-plugin:
  <jdkToolchain></jdkToolchain>
<jlinkTool> File - Explicit path to the jlink tool.
Only if toolchains cannot be used.
See also: org.tentackle.maven.AbstractTentackleMojo.getToolchain()
User Property: jlinkTool
<mainModule> String - The name of the module holding the main class.
If missing, the plugin will build an application running on the classpath.
<minLogLevel> String - The minimum logging java.util.logging.Level to redirect java.util logging to the maven logger.
Default: WARNING
<modulePathOnly> List<String> - List of full-blown modules that should be moved to the module path explicitly.
By default, all full-blown modules are passed to the jlink tool. If a module is listed for the module path only, the module it will be moved to the mp folder instead.
This may become necessary, if a 3rd-party full-blown module (illegally!) requires automatic modules, which would cause all artifacts to be moved to the module path by this plugin automatically, since the jlink tool can only handle full-blown modules.

If all modules must be moved to the mp folder, the single values true, all or * can be used as a shortcut.

Examples:

   <modulePathOnly>
       <module>tentackle.log.log4j2v</module>
       <module>org.apache.logging.log4j</module>
   </modulePathOnly>
or
  <modulePathOnly>all</modulePathOnly>
<noHeaderFiles> boolean - Suppress the includes directory.
Corresponds to the jlink option --no-header-files.
Default: false
<noManPages> boolean - Suppress the man directory.
Corresponds to the jlink option --no-man-pages
Default: false
<resourcesDirectory> File - The directory holding extra resources, such as logger configurations or database credentials, that will be copied to the conf directory.
Defaults to the maven-resources-plugin's destination directory, usually target/classes.
If no resources must be copied, for example in server-images for production, set this to any non-existent directory, for example "none".
Default: ${project.build.directory}/classes
<saveOpts> File - The optional file holding the jlink options.
Corresponds to the jlink option --save-opts.
<skip> Boolean - Skips processing.
Defaults to true if packaging is "pom".
<stripDebug> boolean - Strip debug information.
Corresponds to the jlink option --strip-debug.
Default: false
<templateDir> File - The directory holding the script templates.
Default: ${project.basedir}/templates
<variables> Map<String,Object> - Extra variables for template or artifact generation.

For example the subproject's basedir:

 <variables>
   <project>${project.basedir}</project>
 </variables>
And then use it in package-image.ftl for file paths, such as:
  --icon ${project}/src/pkg/myapp.ico
<verbosity> String - The verbosity.
One of "default", "info" or "debug". Debug is also turned on (if not set explicitly) by Maven's global debug flag (see command line switch -X).
Default: ${tentackle.verbosity}
<withUpdater> boolean - Enables the auto update feature.

For the jlink gaol an extra update script will be generated via the JLinkMojo.getUpdateTemplate(). The update script will be named bin/update.<extension> where the extension is derived from the platform (cmd on Windows, otherwise sh for unixes).

For the jpackage goal an extra ZIP-file is created holding the jpackage image's files and an update script generated via getPackageUpdateTemplate().

For an implementation of the auto-update feature see the Tentackle modules tentackle-update and tentackle-fx-rdc-update. Whereas tentackle-update can be used by any kind of application, the frontend part tentackle-fx-rdc-update requires a Tentackle FX application.

<zipDirectory> File - The directory where to store the ZIP files.
Default: ${project.build.directory}

Parameter Details

<addModules>

Extra jre or jdk modules to add to the image.
Useful to add the runtime localization module or extra tools in bin.

Example:

<addModules>
  <addModule>jdk.localedata</addModule>
  <addModule>jdk.jcmd</addModule>
</addModules>
  • Type: java.util.List<java.lang.String>
  • Required: No

<charset>

The encoding to read and write files.
  • Type: java.lang.String
  • Required: No
  • Default: ${project.build.sourceEncoding}

<classpathDependencies>

Dependencies that should go to the classpath instead of modulepath.
  • Type: java.util.List<org.tentackle.maven.plugin.jlink.ClasspathDependency>
  • Required: No

<compress>

Compression of resources.
Corresponds to the jlink option --compress.
  • Type: java.lang.Integer
  • Required: No

<copyAll>

Controls whether all or only already installed templates should be copied.
By default, all templates are copied to the project's template folder.
Otherwise, only those templates that already exist in the template folder will be overwritten.
  • Type: boolean
  • Required: No
  • Default: true

<excludeModules>

Modules to exclude.
Necessary only if a dependency refers to removed api even if not used at all at runtime.
<excludeModules>
  <excludeModule>jdk8internals</excludeModule>
</excludeModules>
  • Type: java.util.List<java.lang.String>
  • Required: No

<extraClassifier>

Additional classifier to add to deployed artifacts.
  • Type: java.lang.String
  • Required: No

<extraClasspathElements>

Extra classpath elements.
Pathnames are relative to the image root.
  • Type: java.util.List<java.lang.String>
  • Required: No

<extraDirectories>

Extra directories to copy to the image.
  • Type: java.util.List<java.io.File>
  • Required: No

<ignoreSigningInformation>

Suppresses a fatal error when signed modular JARs are linked in the runtime image.
Corresponds to the jlink option --ignore-signing-information
  • Type: boolean
  • Required: No
  • Default: false

<imageDirectory>

The directory created by jlink holding the image.
  • Type: java.io.File
  • Required: Yes
  • Default: ${project.build.directory}/jlink

<jdepsTool>

Explicit path to the jdeps tool.
Only if toolchains cannot be used.
See also: org.tentackle.maven.AbstractTentackleMojo.getToolchain()
  • Type: java.io.File
  • Required: No
  • User Property: jdepsTool

<jdkToolchain>

Toolchain for invocation of external tools.
Explicitly specifies the "jdk" toolchain for this plugin only. Overrides the toolchain selected by the maven-toolchain-plugin, if any.

Example:

  <jdkToolchain>
    <version>14</version>
  </jdkToolchain>
To deselect the toolchain configured by the maven-toolchain-plugin:
  <jdkToolchain></jdkToolchain>
  • Type: java.util.Map<java.lang.String, java.lang.String>
  • Required: No

<jlinkTool>

Explicit path to the jlink tool.
Only if toolchains cannot be used.
See also: org.tentackle.maven.AbstractTentackleMojo.getToolchain()
  • Type: java.io.File
  • Required: No
  • User Property: jlinkTool

<mainClass>

The name of the main class.
  • Type: java.lang.String
  • Required: Yes

<mainModule>

The name of the module holding the main class.
If missing, the plugin will build an application running on the classpath.
  • Type: java.lang.String
  • Required: No

<minLogLevel>

The minimum logging java.util.logging.Level to redirect java.util logging to the maven logger.
  • Type: java.lang.String
  • Required: No
  • Default: WARNING

<modulePathOnly>

List of full-blown modules that should be moved to the module path explicitly.
By default, all full-blown modules are passed to the jlink tool. If a module is listed for the module path only, the module it will be moved to the mp folder instead.
This may become necessary, if a 3rd-party full-blown module (illegally!) requires automatic modules, which would cause all artifacts to be moved to the module path by this plugin automatically, since the jlink tool can only handle full-blown modules.

If all modules must be moved to the mp folder, the single values true, all or * can be used as a shortcut.

Examples:

   <modulePathOnly>
       <module>tentackle.log.log4j2v</module>
       <module>org.apache.logging.log4j</module>
   </modulePathOnly>
or
  <modulePathOnly>all</modulePathOnly>
  • Type: java.util.List<java.lang.String>
  • Required: No

<noHeaderFiles>

Suppress the includes directory.
Corresponds to the jlink option --no-header-files.
  • Type: boolean
  • Required: No
  • Default: false

<noManPages>

Suppress the man directory.
Corresponds to the jlink option --no-man-pages
  • Type: boolean
  • Required: No
  • Default: false

<resourcesDirectory>

The directory holding extra resources, such as logger configurations or database credentials, that will be copied to the conf directory.
Defaults to the maven-resources-plugin's destination directory, usually target/classes.
If no resources must be copied, for example in server-images for production, set this to any non-existent directory, for example "none".
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}/classes

<saveOpts>

The optional file holding the jlink options.
Corresponds to the jlink option --save-opts.
  • Type: java.io.File
  • Required: No

<skip>

Skips processing.
Defaults to true if packaging is "pom".
  • Type: java.lang.Boolean
  • Required: No

<stripDebug>

Strip debug information.
Corresponds to the jlink option --strip-debug.
  • Type: boolean
  • Required: No
  • Default: false

<templateDir>

The directory holding the script templates.
  • Type: java.io.File
  • Required: No
  • Default: ${project.basedir}/templates

<variables>

Extra variables for template or artifact generation.

For example the subproject's basedir:

 <variables>
   <project>${project.basedir}</project>
 </variables>
And then use it in package-image.ftl for file paths, such as:
  --icon ${project}/src/pkg/myapp.ico
  • Type: java.util.Map<java.lang.String, java.lang.Object>
  • Required: No

<variablesPrecedence>

Defines the precedence of properties and variables.
By default, system properties are overridden by maven properties which are overridden by the extra template variables.

The case-insensitive keywords are:

  • system, sys: for system properties
  • maven, mvn, properties, props, pom: maven properties
  • variables, vars, var, extras, extra, template: extra template variables
  • Type: java.lang.String
  • Required: Yes
  • Default: system, maven, variables

<verbosity>

The verbosity.
One of "default", "info" or "debug". Debug is also turned on (if not set explicitly) by Maven's global debug flag (see command line switch -X).
  • Type: java.lang.String
  • Required: No
  • Default: ${tentackle.verbosity}

<withUpdater>

Enables the auto update feature.

For the jlink gaol an extra update script will be generated via the JLinkMojo.getUpdateTemplate(). The update script will be named bin/update.<extension> where the extension is derived from the platform (cmd on Windows, otherwise sh for unixes).

For the jpackage goal an extra ZIP-file is created holding the jpackage image's files and an update script generated via getPackageUpdateTemplate().

For an implementation of the auto-update feature see the Tentackle modules tentackle-update and tentackle-fx-rdc-update. Whereas tentackle-update can be used by any kind of application, the frontend part tentackle-fx-rdc-update requires a Tentackle FX application.

  • Type: boolean
  • Required: No

<zipDirectory>

The directory where to store the ZIP files.
  • Type: java.io.File
  • Required: No
  • Default: ${project.build.directory}