jpacktool:jpackager

Full name:

net.agilhard.maven.plugins:jpacktool-maven-plugin:1.0.0-SNAPSHOT:jpackager

Description:

The JPackager goal can create a native installer packages based on http://openjdk.java.net/jeps/343.

Attributes:

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

Required Parameters

Name Type Since Description
<buildRootPackage> File - Directory in which to use and place temporary files.

--build-root <path>


Default value is: ${project.build.directory}/jpackager-build.
<copyArtifacts> boolean - Flag whether to copy artifact modules to the moduleTempDirectory.

The default value is true. Setting this to false only works if there are no modules with classes in the module hierachy.


Default value is: true.
<moduleTempDirectory> File - TempDirectory where artifact modules are temporarily copied too.
Default value is: ${project.build.directory}/jpackager-jmods.

Optional Parameters

Name Type Since Description
<addJDKToLimitModules> boolean - Toggle whether to add all modules in the java boot path to the limitModules setting.
Default value is: false.
<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>...].


<appImage> File - Location of the predefined application image that is used to build an installable package.

--app-image <path>


<appVersion> String - Version of the application.

Note a -SNAPSHOT or .SNAPSHOT is automatically deleted from the version when constructing the jpackage command line arguments.

--app-version <version>


Default value is: ${project.version}.
<arguments> List - Command line arguments to pass to the main class if no arguments are specified by the launcher.

--arguments <args>


<automaticModulesFolderName> String - Name of the automatic-modules folder
Default value is: jar_auto.
<category> String - Category or group of the application

--category <text>


<classPathFolderName> String - Name of the classpath folder
Default value is: jar.
<classpathArtifacts> List - Artifacts that should be explicitly on the classpath
<copyright> String - Copyright for the application.

--copyright <text>


<description> String - Description of the application.

--description <text>


Default value is: ${project.description}.
<excludedArtifacts> List - Artifacts that should be excluded
<fileAssociations> File - Properties file that contains list of key=value parameters that describe a file association. "extension", "mime-type", "icon", "description" can be used as keys for the association.

--file-associations <path>


<files> List - List of files in the base directory. If omitted, all files from "input" directory (which is a mandatory argument in this case) will be packaged.

--files <files>


<icon> File - Icon of the application bundle.

--icon <path>


<identifier> String - Machine readable identifier of the application. The format must be a DNS name in reverse order, such as com.example.myapplication.

--identifier <identifier>


Default value is: ${project.groupId}.${project.artifactId}.
<ignoreAutomaticModules> boolean - Flag to ignore automatic modules.
Default value is: true.
<installDir> String - Qualified name of the application class to execute.

-install-dir <path>


<jPacktoolMoveAutomaticModules> boolean - Flag if to move real modules from jpacktool-prepare goal
Default value is: true.
<jPacktoolMoveClassPathJars> boolean - Flag if to move classpath jars from jpacktool-prepare goal
Default value is: true.
<jPacktoolMoveRealModules> boolean - Flag if to move real modules from jpacktool-prepare goal. This can not be set to true when using jpackager because jpackager explicitly disallows modules in input directories.
Default value is: false.
<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
<jvmArgs> List - JVM flags and options to pass to the application.

--jvm-args <args>


<licenseFile> String - The license file, relative to the base directory.

--license-file <path>


<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>...]


<linuxOptions> JPackagerLinuxOptions - Linux Options.

Available subelements of <LinuxOptions> are: bundleName, packageDeps, rpmLicenseType, debMaintainer and linuxType.


<macOptions> JPackagerMacOptions - Mac Options

Available subelements of <MacOptions> are: sign, bundleName, bundleIdentifier, appStoreCategory, appStoreEntitlements, bundleSigningPrefix, signingKeyUserName, signingKeychain and macType.


<mainClass> String - Qualified name of the application class to execute.

-class <className>


<mainJar> String - The main JAR of the application. This JAR should have the main-class, and is relative to the assembled application directory.

--main-jar<jarname>


<module> String - Main module of the application. This module must have the main-class, and be on the module path.

--module <name>


<modulePaths> List - Include additional paths on the --module-path option. Project dependencies and JDK modules are automatically added.
<modulesFolderName> String - Name of the modules folder
Default value is: jmods.
<name> String - Name of the application.

--name <name>


Default value is: ${project.name}.
<packageType> String - Installer type of JPackager operation.

Valid values for <type> are "msi", "rpm", "deb", "dmg", "pkg", "pkg-app-store".

If <type> is omitted a value from the platform specific settings <linuxType>, <windowsType> or <macType> is being used.


User property is: jlink-jpackager.package-type.
<packagingResources> PackagingResources - Resources to package into the image or installable package.

You can use almost any configuration option that the Apache Maven Resources Plugin has on this setting.

When filtering is set to true on a resource the Freemarker Java Template Engine is being used to filter the contents and some variables set by the packaging process are available to it.

Hava a look at the Template Author's Guide for details on how to write templates.


<resourceDir> String - This argument defines the path (absolute or relative) to the resource directory which overrides jpackage resources, including icons, template files or other files.
<runtimeImage> File - Location of the predefined runtime image that is used to build an application image and installable package.

--runtime-image <path>


<secondaryLauncher> File - Properties file that contains a collection of options for a secondary launcher.

--secondary-launcher <path>


<skip> boolean - skip plugin execution.
Default value is: false.
<skipModulesInclude> boolean - Skip including of modules.
Default value is: false.
<sourceJdkModules> File - Set the JDK location to create a Java custom runtime image.
<unfilteredDependencyHandling> boolean - Fall back to using old unfiltered maven dependency handling.
Default value is: false.
<vendor> String - Vendor of the application.

--vendor <text>


Default value is: ${project.organization}.
<verbose> boolean - This will turn on verbose mode.

The jlink/jpackager command line equivalent is: --verbose


Default value is: false.
<windowsOptions> JPackagerWindowsOptions - Windows Options

Available subelements of <WindowsOptions> are: menu, menuGroup, perUserInstall, dirChooser, registryName, upgradeUUID, shortcut, console and windowsType.


Parameter Details

<addJDKToLimitModules>

Toggle whether to add all modules in the java boot path to the limitModules setting.
  • Type: boolean
  • Required: No
  • Default: false

<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

<appImage>

Location of the predefined application image that is used to build an installable package.

--app-image <path>

  • Type: java.io.File
  • Required: No

<appVersion>

Version of the application.

Note a -SNAPSHOT or .SNAPSHOT is automatically deleted from the version when constructing the jpackage command line arguments.

--app-version <version>

  • Type: java.lang.String
  • Required: No
  • Default: ${project.version}

<arguments>

Command line arguments to pass to the main class if no arguments are specified by the launcher.

--arguments <args>

  • Type: java.util.List
  • Required: No

<automaticModulesFolderName>

Name of the automatic-modules folder
  • Type: java.lang.String
  • Required: No
  • Default: jar_auto

<buildRootPackage>

Directory in which to use and place temporary files.

--build-root <path>

  • Type: java.io.File
  • Required: Yes
  • Default: ${project.build.directory}/jpackager-build

<category>

Category or group of the application

--category <text>

  • Type: java.lang.String
  • Required: No

<classPathFolderName>

Name of the classpath folder
  • Type: java.lang.String
  • Required: No
  • Default: jar

<classpathArtifacts>

Artifacts that should be explicitly on the classpath
  • Type: java.util.List
  • Required: No

<copyArtifacts>

Flag whether to copy artifact modules to the moduleTempDirectory.

The default value is true. Setting this to false only works if there are no modules with classes in the module hierachy.

  • Type: boolean
  • Required: Yes
  • Default: true

<copyright>

Copyright for the application.

--copyright <text>

  • Type: java.lang.String
  • Required: No

<description>

Description of the application.

--description <text>

  • Type: java.lang.String
  • Required: No
  • Default: ${project.description}

<excludedArtifacts>

Artifacts that should be excluded
  • Type: java.util.List
  • Required: No

<fileAssociations>

Properties file that contains list of key=value parameters that describe a file association. "extension", "mime-type", "icon", "description" can be used as keys for the association.

--file-associations <path>

  • Type: java.io.File
  • Required: No

<files>

List of files in the base directory. If omitted, all files from "input" directory (which is a mandatory argument in this case) will be packaged.

--files <files>

  • Type: java.util.List
  • Required: No

<icon>

Icon of the application bundle.

--icon <path>

  • Type: java.io.File
  • Required: No

<identifier>

Machine readable identifier of the application. The format must be a DNS name in reverse order, such as com.example.myapplication.

--identifier <identifier>

  • Type: java.lang.String
  • Required: No
  • Default: ${project.groupId}.${project.artifactId}

<ignoreAutomaticModules>

Flag to ignore automatic modules.
  • Type: boolean
  • Required: No
  • Default: true

<installDir>

Qualified name of the application class to execute.

-install-dir <path>

  • Type: java.lang.String
  • Required: No

<jPacktoolMoveAutomaticModules>

Flag if to move real modules from jpacktool-prepare goal
  • Type: boolean
  • Required: No
  • Default: true

<jPacktoolMoveClassPathJars>

Flag if to move classpath jars from jpacktool-prepare goal
  • Type: boolean
  • Required: No
  • Default: true

<jPacktoolMoveRealModules>

Flag if to move real modules from jpacktool-prepare goal. This can not be set to true when using jpackager because jpackager explicitly disallows modules in input directories.
  • Type: boolean
  • Required: No
  • Default: false

<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

<jvmArgs>

JVM flags and options to pass to the application.

--jvm-args <args>

  • Type: java.util.List
  • Required: No

<licenseFile>

The license file, relative to the base directory.

--license-file <path>

  • 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

<linuxOptions>

Linux Options.

Available subelements of <LinuxOptions> are: bundleName, packageDeps, rpmLicenseType, debMaintainer and linuxType.

  • Type: net.agilhard.maven.plugins.jpacktool.base.mojo.jpackager.JPackagerLinuxOptions
  • Required: No

<macOptions>

Mac Options

Available subelements of <MacOptions> are: sign, bundleName, bundleIdentifier, appStoreCategory, appStoreEntitlements, bundleSigningPrefix, signingKeyUserName, signingKeychain and macType.

  • Type: net.agilhard.maven.plugins.jpacktool.base.mojo.jpackager.JPackagerMacOptions
  • Required: No

<mainClass>

Qualified name of the application class to execute.

-class <className>

  • Type: java.lang.String
  • Required: No

<mainJar>

The main JAR of the application. This JAR should have the main-class, and is relative to the assembled application directory.

--main-jar<jarname>

  • Type: java.lang.String
  • Required: No

<module>

Main module of the application. This module must have the main-class, and be on the module path.

--module <name>

  • Type: java.lang.String
  • 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

<moduleTempDirectory>

TempDirectory where artifact modules are temporarily copied too.
  • Type: java.io.File
  • Required: Yes
  • Default: ${project.build.directory}/jpackager-jmods

<modulesFolderName>

Name of the modules folder
  • Type: java.lang.String
  • Required: No
  • Default: jmods

<name>

Name of the application.

--name <name>

  • Type: java.lang.String
  • Required: No
  • Default: ${project.name}

<packageType>

Installer type of JPackager operation.

Valid values for <type> are "msi", "rpm", "deb", "dmg", "pkg", "pkg-app-store".

If <type> is omitted a value from the platform specific settings <linuxType>, <windowsType> or <macType> is being used.

  • Type: java.lang.String
  • Required: No
  • User Property: jlink-jpackager.package-type

<packagingResources>

Resources to package into the image or installable package.

You can use almost any configuration option that the Apache Maven Resources Plugin has on this setting.

When filtering is set to true on a resource the Freemarker Java Template Engine is being used to filter the contents and some variables set by the packaging process are available to it.

Hava a look at the Template Author's Guide for details on how to write templates.

  • Type: net.agilhard.maven.plugins.jpacktool.base.mojo.PackagingResources
  • Required: No

<resourceDir>

This argument defines the path (absolute or relative) to the resource directory which overrides jpackage resources, including icons, template files or other files.
  • Type: java.lang.String
  • Required: No

<runtimeImage>

Location of the predefined runtime image that is used to build an application image and installable package.

--runtime-image <path>

  • Type: java.io.File
  • Required: No

<secondaryLauncher>

Properties file that contains a collection of options for a secondary launcher.

--secondary-launcher <path>

  • Type: java.io.File
  • Required: No

<skip>

skip plugin execution.
  • Type: boolean
  • Required: No
  • Default: false

<skipModulesInclude>

Skip including of modules.
  • Type: boolean
  • Required: No
  • Default: false

<sourceJdkModules>

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

<unfilteredDependencyHandling>

Fall back to using old unfiltered maven dependency handling.
  • Type: boolean
  • Required: No
  • Default: false

<vendor>

Vendor of the application.

--vendor <text>

  • Type: java.lang.String
  • Required: No
  • Default: ${project.organization}

<verbose>

This will turn on verbose mode.

The jlink/jpackager command line equivalent is: --verbose

  • Type: boolean
  • Required: No
  • Default: false

<windowsOptions>

Windows Options

Available subelements of <WindowsOptions> are: menu, menuGroup, perUserInstall, dirChooser, registryName, upgradeUUID, shortcut, console and windowsType.

  • Type: net.agilhard.maven.plugins.jpacktool.base.mojo.jpackager.JPackagerWindowsOptions
  • Required: No