Class Link

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.Task
org.apache.tools.ant.taskdefs.modules.Link
All Implemented Interfaces:
Cloneable

public class Link extends Task
Assembles jmod files into an executable image. Equivalent to the JDK jlink command.

Supported attributes:

destDir
Root directory of created image. (required)
modulePath
Path of modules. Should be a list of .jmod files. Required, unless nested module path or modulepathref is present.
modulePathRef
Reference to path of modules. Referenced path should be a list of .jmod files.
modules
Comma-separated list of modules to assemble. Required, unless one or more nested <module> elements are present.
observableModules
Comma-separated list of explicit modules that comprise "universe" visible to tool while linking.
launchers
Comma-separated list of commands, each of the form name=module or name=module/mainclass
excludeFiles
Comma-separated list of patterns specifying files to exclude from linked image. Each is either a standard PathMatcher pattern or @filename.
excludeResources
Comma-separated list of patterns specifying resources to exclude from jmods. Each is either a standard PathMatcher pattern or @filename.
locales
Comma-separated list of extra locales to include, requires jdk.localedata module
resourceOrder
Comma-separated list of patterns specifying resource search order. Each is either a standard PathMatcher pattern or @filename.
bindServices
boolean, whether to link service providers; default is false
ignoreSigning
boolean, whether to allow signed jar files; default is false
includeHeaders
boolean, whether to include header files; default is true
includeManPages
boolean, whether to include man pages; default is true
includeNativeCommands
boolean, whether to include native executables normally generated for image; default is true
debug
boolean, whether to include debug information; default is true
verboseLevel
If set, jlink will produce verbose output, which will be logged at the specified Ant log level (DEBUG, VERBOSE, INFO}, WARN, or ERR).
compress
compression level, one of:
0
none
no compression (default)
1
strings
constant string sharing
2
zip
zip compression
endianness
Must be little or big, default is native endianness
checkDuplicateLegal
Boolean. When merging legal notices from different modules because they have the same name, verify that their contents are identical. Default is false, which means any license files with the same name are assumed to have the same content, and no checking is done.
vmType
Hotspot VM in image, one of:
  • client
  • server
  • minimal
  • all (default)

Supported nested elements

<modulepath>
path element
<module>
May be specified multiple times. Only attribute is required name attribute.
<observableModule>
May be specified multiple times. Only attribute is required name attribute.
<launcher>
May be specified multiple times. Attributes:
  • name (required)
  • module (required)
  • mainClass (optional)
<locale>
May be specified multiple times. Only attribute is required name attribute.
<resourceOrder>
Explicit resource search order in image. May be specified multiple times. Exactly one of these attributes must be specified:
pattern
A standard PathMatcher pattern
listFile
Text file containing list of resource names (not patterns), one per line
If the resourceOrder attribute is also present on the task, its patterns are treated as if they occur before patterns in nested <resourceOrder> elements.
<excludeFiles>
Excludes files from linked image tree. May be specified multiple times. Exactly one of these attributes is required:
pattern
A standard PathMatcher pattern
listFile
Text file containing list of file names (not patterns), one per line
<excludeResources>
Excludes resources from jmods. May be specified multiple times. Exactly one of these attributes is required:
pattern
A standard PathMatcher pattern
listFile
Text file containing list of resource names (not patterns), one per line
<compress>
Must have level attribute, whose permitted values are the same as the compress task attribute described above. May also have a files attribute, which is a comma-separated list of patterns, and/or nested <files> elements, each with either a pattern attribute or listFile attribute.
<releaseInfo>
Replaces, augments, or trims the image's release info properties. This may specify any of the following:
  • A file attribute, pointing to a Java properties file containing new release info properties that will entirely replace the current ones.
  • A delete attribute, containing comma-separated property keys to remove from application's release info, and/or any number of nested <delete> elements, each with a required key attribute.
  • One or more nested <add> elements, containing either key and value attributes, or a file attribute and an optional charset attribute.
Since:
1.10.6
See Also: