Native Image
Creates a Native Image binary using GraalVM Native Image.
You need a local installation of GraalVM. JReleaser will not install GraalVM for you, however it can
install the native-image command if needed. You may configure the JDKs Maven Plugin or the
JDKs Gradle Plugin to downloads a GraalVM distribution.
|
Legend:
-
required
-
optional
-
may use environment variable
-
accepts Name Templates
#
assemble:
#
nativeImage:
# Assemblers require a name.
#
app:
# Enables or disables the assembler.
# Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
# Defaults to `NEVER`.
#
active: ALWAYS
# Export the assembled artifacts as a matching named distribution.
# Defaults to `true`.
#
exported: true
# The stereotype of this assembler.
# Supported values are [`NONE`, `CLI`, `DESKTOP`, `WEB`, `MOBILE`].
# Defaults to `${project.stereotype}`.
#
stereotype: CLI
# Additional properties used when evaluating templates.
#
extraProperties:
# Key will be capitalized and prefixed with `nativeImage`, i.e, `nativeImageFoo`.
foo: bar
#
platform:
# Key value pairs.
# Keys match a full platform or an os.name, os.arch.
# Same rules apply as in Platform.
#
replacements:
osx-x86_64: mac
aarch_64: aarch64
x86_64: amd64
linux_musl: alpine
# Name of the executable launcher.
# If left undefined, will use ${assembler.name}.
#
executable: app
# Directory with file templates used to prepare the NativeImage assembler.
# Defaults to `src/jreleaser/assemblers/${distribution.name}/nativeImage`.
# If specified, path must exist.
#
templateDirectory: path/to/nativeImage/templates
# Name of the generated image.
# If left undefined, will use
# ${assembler.executable}-${project.version}.
# Generated artifacts always have the platform as suffix.
#
imageName: 'app-{{projectVersion}}'
# Name transformation of the generated image.
# Transformed artifacts always have the platform as suffix.
#
imageNameTransform: 'app-{{projectEffectiveVersion}}'
# Archive format to use.
# Supported values are [`ZIP`, `TAR`, `TAR_BZ2`, `TAR_GZ`, `TAR_XZ`, `TBZ2`, `TGZ`, `TXZ`].
# Defaults to `ZIP`.
#
archiveFormat: TGZ
# List of Graal JDKs.
#
targetJdks:
- path: path/to/jdk
platform: osx-x86_64
- path: path/to/jdk
platform: linux-x86_64
# A list of build arguments.
# The `-H:Name` argument will always be replaced with the
# value of $executable.
#
args:
- '--install-exit-handlers'
# A list of additional GraalVM components to be installed.
#
components:
- 'espresso'
# Compress the resulting executable with UPX.
#
upx:
# Enables or disables UPX.
# Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
# Defaults to `NEVER`.
#
active: ALWAYS
# Tool version.
#
version: '3.96'
# A list of arguments.
#
args:
- '-f'
#
linux:
# A list of arguments.
#
args:
- '--static'
#
windows:
# A list of arguments.
#
args:
- '--foo'
#
osx:
# A list of arguments.
#
args:
- '--bar'
# The executable JAR that contains the application.
#
mainJar:
path: path/to/app.jar
# Defines a list of additional JARs as globs.
#
jars:
# The pattern to use.
# May use glob or regex pattern syntax.
#
- pattern: path/to/**/*.jar
#
java:
# Name of main module (if any).
# Define only if the application is modular.
#
mainModule: com.acme.demo
# The application's entry point.
# If left undefined, will use ${project.java.mainClass}.
#
mainClass: com.acme.Main
# Maven coordinates: groupId.
# If left undefined, will use ${project.java.groupId}.
#
groupId: com.acme
# Maven coordinates: artifactId.
# If left undefined, will use ${project.java.artifactId}.
#
artifactId: app
# The minimum Java version required by consumers to run the application.
# If left undefined, will use ${project.java.version}.
#
version: 8
# Identifies the project as being member of a multi-project build.
# If left undefined, will use ${project.java.multiProject}.
#
multiProject: false
# Additional properties used when evaluating templates.
#
extraProperties:
# Key will be capitalized and prefixed with `java`, i.e, `javaFoo`.
foo: bar
# Defines a list of additional files as globs.
# These files will be added to the assembled Zip file.
#
files:
# The pattern to use.
# May use glob or regex pattern syntax.
#
- pattern: path/to/**/*.txt
# Defines a list of additional files as filesets.
# These files will be added to the assembled Zip file.
#
fileSets:
# The input directory to copy files from.
#
- input: path/to/input/directory
# The target path inside the archive.
# If left undefined, defaults to the root of the archive.
#
output: path/to/archive/entry
# Fail if the given `input` does not exist.
# Defaults to `true`.
#
failOnMissingInput: false
# A set of files and directory to include.
#
includes:
- 'name_or_regex'
# A set of files and directory to exclude.
#
excludes:
- 'name_or_regex'
# Additional properties used when evaluating templates.
#
extraProperties:
# Key will be capitalized and prefixed with `artifact`, i.e, `artifactFoo`.
foo: bar
# Assemblers require a name.
#
[assemble.nativeImage.app]
# Enables or disables the assembler.
# Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
# Defaults to `NEVER`.
#
active = "ALWAYS"
# Export the assembled artifacts as a matching named distribution.
# Defaults to `true`.
#
exported = true
# The stereotype of this assembler.
# Supported values are [`NONE`, `CLI`, `DESKTOP`, `WEB`, `MOBILE`].
# Defaults to `${project.stereotype}`.
#
stereotype = "CLI"
# Additional properties used when evaluating templates.
#
extraProperties.foo = "bar"
# Key will be capitalized and prefixed with `nativeImage`, i.e, `nativeImageFoo`.
# Key value pairs.
# Keys match a full platform or an os.name, os.arch.
# Same rules apply as in Platform.
#
[assemble.nativeImage.app.platform.replacements]
osx-x86_64 = "mac"
aarch_64 = "aarch64"
x86_64 = "amd64"
linux_musl = "alpine"
# Name of the executable launcher.
# If left undefined, will use ${assembler.name}.
#
executable = "app"
# Directory with file templates used to prepare the NativeImage assembler.
# Defaults to `src/jreleaser/assemblers/${distribution.name}/nativeImage`.
# If specified, path must exist.
#
templateDirectory = "path/to/nativeImage/templates"
# Name of the generated image.
# If left undefined, will use
# ${assembler.executable}-${project.version}.
# Generated artifacts always have the platform as suffix.
#
imageName = "app-{{projectVersion}}"
# Name transformation of the generated image.
# Transformed artifacts always have the platform as suffix.
#
imageNameTransform = "app-{{projectEffectiveVersion}}"
# Archive format to use.
# Supported values are [`ZIP`, `TAR`, `TAR_BZ2`, `TAR_GZ`, `TAR_XZ`, `TBZ2`, `TGZ`, `TXZ`].
# Defaults to `ZIP`.
#
archiveFormat = "TGZ"
# List of Graal JDKs.
#
targetJdks = [
{ path = "path/to/jdk", platform = "osx-x86_64" },
{ path = "path/to/jdk", platform = "linux-x86_64" }]
# A list of build arguments.
# The `-H:Name` argument will always be replaced with the
# value of $executable.
#
args = ["--install-exit-handlers"]
# A list of additional GraalVM components to be installed.
#
components = ["espresso"]
# Compress the resulting executable with UPX.
#
[assemble.nativeImage.app.upx]
# Enables or disables UPX.
# Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
# Defaults to `NEVER`.
#
active = "ALWAYS"
# Tool version.
#
version = "3.96"
# A list of arguments.
#
args = ["-f]
#
[assemble.nativeImage.app.linux]
# A list of arguments.
#
args = ["--static]
#
[assemble.nativeImage.app.windows]
# A list of arguments.
#
args = ["--foo]
#
[assemble.nativeImage.app.osx]
# A list of arguments.
#
args = ["--bar]
# The executable JAR that contains the application.
#
mainJar = { path = "path/to/app.jar" }
# Defines a list of additional JARs as globs.
#
[[assemble.jlink.app.jars]]
# The pattern to use.
# May use glob or regex pattern syntax.
#
pattern = "path/to/**/*.jar"
# Name of main module (if any).
# Define only if the application is modular.
#
java.mainModule = "com.acme.demo"
# The application's entry point.
# If left undefined, will use ${project.java.mainClass}.
#
java.mainClass = "com.acme.Main"
# Maven coordinates: groupId.
# If left undefined, will use ${project.java.groupId}.
#
java.groupId = "com.acme"
# Maven coordinates: artifactId.
# If left undefined, will use ${project.java.artifactId}.
#
java.artifactId = "app"
# The minimum Java version required by consumers to run the application.
# If left undefined, will use ${project.java.version}.
#
java.version = "8"
# Identifies the project as being member of a multi-project build.
# If left undefined, will use ${project.java.multiProject}.
#
java.multiProject = false
# Additional properties used when evaluating templates.
#
java.extraProperties.foo = "bar"
# Key will be capitalized and prefixed with `java`, i.e, `javaFoo`.
# Defines a list of additional files as globs.
# These files will be added to the assembled Zip file.
#
[[assemble.nativeImage.app.files]]
# The pattern to use.
# May use glob or regex pattern syntax.
#
pattern = "path/to/**/*.txt"
# Defines a list of additional files as filesets.
# These files will be added to the assembled Zip file.
#
[[assemble.nativeImage.app.fileSets]]
# The input directory to copy files from.
#
input = "path/to/input/directory"
# The target path inside the archive.
# If left undefined, defaults to the root of the archive.
#
output = "path/to/archive/entry"
# Fail if the given `input` does not exist.
# Defaults to `true`.
#
failOnMissingInput = false
# A set of files and directory to include.
#
includes = ["name_or_regex"]
# A set of files and directory to exclude.
#
excludes = ["name_or_regex"]
# Additional properties used when evaluating templates.
#
[[assemble.nativeImage.app.fileSets.extraProperties]]
# Key will be capitalized and prefixed with `artifact`, i.e, `artifactFoo`.
foo: bar
{
//
"assemble": {
//
"nativeImage": {
// Assemblers require a name.
//
"app": {
// Enables or disables the assembler.
// Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
// Defaults to `NEVER`.
//
"active": "ALWAYS",
// Export the assembled artifacts as a matching named distribution.
// Defaults to `true`.
//
"exported": true,
// The stereotype of this assembler.
// Supported values are [`NONE`, `CLI`, `DESKTOP`, `WEB`, `MOBILE`].
// Defaults to `${project.stereotype}`.
//
"stereotype": "CLI",
// Additional properties used when evaluating templates.
//
"extraProperties": {
// Key will be capitalized and prefixed with `nativeImage`, i.e, `nativeImageFoo`.
"foo": "bar"
},
//
platform: {
// Key value pairs.
// Keys match a full platform or an os.name, os.arch.
// Same rules apply as in Platform.
//
"replacements": {
"osx-x86_64": "mac",
"aarch_64": "aarch64",
"x86_64": "amd64",
"linux_musl": "alpine"
}
},
// Name of the executable launcher.
// If left undefined, will use ${assembler.name}.
//
"executable": "app",
// Directory with file templates used to prepare the NativeImage assembler.
// Defaults to `src/jreleaser/assemblers/${distribution.name}/nativeImage`.
// If specified, path must exist.
//
"templateDirectory": "path/to/nativeImage/templates",
// Name of the generated image.
// If left undefined, will use
// ${assembler.executable}-${project.version}.
// Generated artifacts always have the platform as suffix.
//
"imageName": "app-{{projectVersion}}",
// Name transformation of the generated image.
// Transformed artifacts always have the platform as suffix.
//
"imageNameTransform": "app-{{projectEffectiveVersion}}",
// Archive format to use.
// Supported values are [`ZIP`, `TAR`, `TAR_BZ2`, `TAR_GZ`, `TAR_XZ`, `TBZ2`, `TGZ`, `TXZ`].
// Defaults to `ZIP`.
//
"archiveFormat": "TGZ",
// List of Graal JDKs.
//
"targetJdks": [
{
"path": "path/to/jdk",
"platform": "osx-x86_64"
},
{
"path": "path/to/jdk",
"platform": "linux-x86_64"
}
],
// A list of build arguments.
// The `-H:Name` argument will always be replaced with the
// value of $executable.
//
"args": [
"--install-exit-handlers"
],
// A list of additional GraalVM components to be installed.
//
"components": [
"espresso"
],
// Compress the resulting executable with UPX.
//
"upx": {
// Enables or disables UPX.
// Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
// Defaults to `NEVER`.
//
"active": "ALWAYS",
// Tool version.
//
"version": "3.96",
// A list of arguments.
//
"args": ["-f"]
},
//
"linux": {
// A list of arguments.
//
"args": ["--static"]
},
//
"windows": {
// A list of arguments.
//
"args": ["--foo"]
},
//
"osx": {
// A list of arguments.
//
"args": ["--bar"]
},
// The executable JAR that contains the application.
//
"mainJar": {
"path": "path/to/app.jar"
},
// Defines a list of additional JARs as globs.
//
"jars": [
{
// The pattern to use.
// May use glob or regex pattern syntax.
//
"pattern": "path/to/**/*.jar"
}
],
//
"java": {
// Name of main module (if any).
// Define only if the application is modular.
//
"mainModule": "com.acme.demo",
// The application's entry point.
// If left undefined, will use ${project.java.mainClass}.
//
"mainClass": "com.acme.Main",
// Maven coordinates: groupId.
// If left undefined, will use ${project.java.groupId}.
//
"groupId": "com.acme",
// Maven coordinates: artifactId.
// If left undefined, will use ${project.java.artifactId}.
//
"artifactId": "app",
// The minimum Java version required by consumers to run the application.
// If left undefined, will use ${project.java.version}.
//
"version": "8",
// Identifies the project as being member of a multi-project build.
// If left undefined, will use ${project.java.multiProject}.
//
"multiProject": false,
// Additional properties used when evaluating templates.
//
"extraProperties": {
// Key will be capitalized and prefixed with `java`, i.e, `javaFoo`.
"foo": "bar"
}
},
// Defines a list of additional files as globs.
// These files will be added to the assembled Zip file.
//
"files": [
{
// The pattern to use.
// May use glob or regex pattern syntax.
//
"pattern": "path/to/**/*.txt"
}
],
// Defines a list of additional files as filesets.
// These files will be added to the assembled Zip file.
//
"fileSets": [
{
// The input directory to copy files from.
//
"input": "path/to/input/directory",
// The target path inside the archive.
// If left undefined, defaults to the root of the archive.
//
"output": "path/to/archive/entry",
// Fail if the given `input` does not exist.
// Defaults to `true`.
//
"failOnMissingInput": false,
// A set of files and directory to include.
//
"includes": ["name_or_regex"],
// A set of files and directory to exclude.
//
"excludes": ["name_or_regex"],
// Additional properties used when evaluating templates.
//
"extraProperties": {
// Key will be capitalized and prefixed with `artifact`, i.e, `artifactFoo`.
"foo": "bar"
}
}
]
}
}
}
}
<jreleaser>
<!--
-->
<assemble>
<!--
-->
<nativeImage>
<!--
Assemblers require a name.
-->
<app>
<!--
Enables or disables the distribution.
Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
Defaults to `ALWAYS`.
-->
<active>ALWAYS</active>
<!--
Export the assembled artifacts as a matching named distribution.
Defaults to `true`.
-->
<exported>true</exported>
<!--
The stereotype of this assembler.
Supported values are [`NONE`, `CLI`, `DESKTOP`, `WEB`, `MOBILE`].
Defaults to `${project.stereotype}`.
-->
<stereotype>CLI</stereotype>
<!--
Additional properties used when evaluating templates.
-->
<extraProperties>
<!--
Key will be capitalized and prefixed with `nativeImage`, i.e, `nativeImageFoo`.
-->
<foo>bar</foo>
</extraProperties>
<!--
-->
<platform>
<!--
Key value pairs.
Keys match a full platform or an os.name, os.arch.
Same rules apply as in Platform.
-->
<replacements>
<osx-x86_64>mac</osx-x86_64>
<aarch_64>aarch64</aarch_64>
<x86_64>amd64</x86_64>
<linux_musl>alpine</linux_musl>
</replacements>
</platform>
<!--
Name of the executable launcher.
If left undefined, will use ${distribution.name}.
-->
<executable>app</executable>
<!--
Directory with file templates used to prepare the NativeImage assembler.
Defaults to `src/jreleaser/assemblers/${distribution.name}/nativeImage`.
If specified, path must exist.
-->
<templateDirectory>path/to/brew/templates</templateDirectory>
<!--
Name of the generated image.
If left undefined, will use
${assembler.executable}-${project.version}.
Generated artifacts always have the platform as suffix.
-->
<imageName>app-{{projectVersion}}</imageName>
<!--
Name transformation of the generated image.
Transformed artifacts always have the platform as suffix.
-->
<imageNameTransform>app</imageNameTransform>
<!--
Archive format to use.
Supported values are [`ZIP`, `TAR`, `TAR_BZ2`, `TAR_GZ`, `TAR_XZ`, `TBZ2`, `TGZ`, `TXZ`].
Defaults to `ZIP`.
-->
<archiveFormat>TGZ</archiveFormat>
<!--
List of Graal JDKs.
-->
<targetJdks>
<graalJdk>
<path>path/to/jdk</path>
<platform>osx-x86_64</platform>
</graalJdk>
<graalJdk>
<path>path/to/jdk</path>
<platform>linux-x86_64</platform>
</graalJdk>
</targetJdks>
<!--
A list of build arguments.
The `-H =Name` argument will always be replaced with the
value of $executable.
-->
<args>
<arg>--install-exit-handlers</arg>
</args>
<!--
A list of additional GraalVM components to be installed.
-->
<components>
<component>espresso</component>
<components>
<!--
Compress the resulting executable with UPX.
--->
<upx>
<!--
Enables or disables UPX.
Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
Defaults to `NEVER`.
-->
<active>ALWAYS</active>
<!--
Tool version.
-->
<version>3.96</version>
<!--
A list of arguments.
-->
<args>
<arg>-f</arg>
</args>
</upx>
<!--
--->
<linux>
<!--
A list of arguments.
-->
<args>
<arg>--static</arg>
</args>
</linux>
<!--
--->
<windows>
<!--
A list of arguments.
-->
<args>
<arg>--foo</arg>
</args>
</windows>
<!--
--->
<osx>
<!--
A list of arguments.
-->
<args>
<arg>--bar</arg>
</args>
</osx>
<!--
The executable JAR that contains the application.
-->
<mainJar>
<path>path/to/app.jar</path>
</mainJar>
<!--
Defines a list of additional JARs as globs.
-->
<jars>
<jar>
<!--
The pattern to use.
May use glob or regex pattern syntax.
-->
<pattern>path/to/**/*.jar</pattern>
</jar>
</jars>
<!--
-->
<java>
<!--
Name of main module (if any).
Define only if the application is modular.
-->
<mainModule>com.acme.demo</mainModule>
<!--
The application's entry point.
If left undefined, will use ${project.java.mainClass}.
-->
<mainClass>com.acme.Main</mainClass>
<!--
Maven coordinates>groupId.
If left undefined, will use ${project.java.groupId}.
-->
<groupId>com.acme</groupId>
<!--
Maven coordinates>artifactId.
If left undefined, will use ${project.java.artifactId}.
-->
<artifactId>app</artifactId>
<!--
The minimum Java version required by consumers to run the application.
If left undefined, will use ${project.java.version}.
-->
<version>8</version>
<!--
Identifies the project as being member of a multi-project build.
If left undefined, will use ${project.java.multiProject}.
-->
<multiProject>false</multiProject>
<!--
Additional properties used when evaluating templates.
-->
<extraProperties>
<!--
Key will be capitalized and prefixed with `java`, i.e, `javaFoo`.
-->
<foo>bar</foo>
</extraProperties>
</java>
<!--
Defines a list of additional files as globs.
These files will be added to the assembled Zip file.
-->
<files>
<file>
<!--
The pattern to use.
May use glob or regex pattern syntax.
-->
<pattern>path/to/**/*.txt</pattern>
</file>
</files>
<!--
Defines a list of additional files as filesets.
These files will be added to the assembled Zip file.
-->
<fileSets>
<fileSet>
<!--
The input directory to copy files from.
-->
<input>path/to/input/directory</input>
<!--
The target path inside the archive.
If left undefined, defaults to the root of the archive.
-->
<output>path/to/archive/entry</output>
<!--
Fail if the given `input` does not exist.
Defaults to `true`.
-->
<failOnMissingInput>false</failOnMissingInput>
<!--
A set of files and directory to include.
-->
<includes>
<include>name_or_regex</include>
</includes>
<!--
A set of files and directory to exclude.
-->
<excludes>
<exclude>name_or_regex</exclude>
</excludes>
<!--
Additional properties used when evaluating templates.
-->
<extraProperties>
<!--
Key will be capitalized and prefixed with `artifact`, i.e, `artifactFoo`.
-->
<foo>bar</foo>
</extraProperties>
</fileSet>
</fileSets>
</app>
</nativeImage>
</assemble>
</jreleaser>
jreleaser {
//
assemble {
//
nativeImage {
// Assemblers require a name.
//
app {
// Enables or disables the assembler.
// Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
// Defaults to `NEVER`.
//
active = 'ALWAYS'
// Export the assembled artifacts as a matching named distribution.
// Defaults to `true`.
//
exported = true
// The stereotype of this assembler.
// Supported values are [`NONE`, `CLI`, `DESKTOP`, `WEB`, `MOBILE`].
// Defaults to `${project.stereotype}`.
//
stereotype = 'CLI'
// Additional properties used when evaluating templates.
// Key will be capitalized and prefixed with `nativeImage`, i.e, `nativeImageFoo`.
//
extraProperties.put('foo', 'bar')
//
platform {
// Key value pairs.
// Keys match a full platform or an os.name, os.arch.
// Same rules apply as in Platform.
//
replacements = [
'osx-x86_64': 'mac',
aarch_64: 'aarch64',
x86_64: 'amd64',
linux_musl: 'alpine'
]
}
// Name of the executable launcher.
// If left undefined, will use ${assembler.name}.
//
executable = 'app'
// Directory with file templates used to prepare the NativeImage assembler.
// Defaults to `src/jreleaser/assemblers/${distribution.name}/nativeImage`.
// If specified, path must exist.
//
templateDirectory = 'path/to/nativeImage/templates'
// Name of the generated image.
// If left undefined, will use
// ${assembler.executable}-${project.version}.
// Generated artifacts always have the platform as suffix.
//
imageName = 'app-{{projectVersion}}'
// Name transformation of the generated image.
// Transformed artifacts always have the platform as suffix.
//
imageNameTransform = 'app-{{projectEffectiveVersion}}'
// Archive format to use.
// Supported values are [`ZIP`, `TAR`, `TAR_BZ2`, `TAR_GZ`, `TAR_XZ`, `TBZ2`, `TGZ`, `TXZ`].
// Defaults to `ZIP`.
//
archiveFormat = 'TGZ'
// List of Graal JDKs.
//
graalJdk {
path = 'path/to/jdk'
platform = 'osx-x86_64'
}
graalJdk {
path = 'path/to/jdk'
platform = 'linux-x86_64'
}
// A list of build arguments.
// The `-H =Name` argument will always be replaced with the
// value of $executable.
//
arg('--install-exit-handlers')
// A list of additional GraalVM components to be installed.
//
component('espresso')
// Compress the resulting executable with UPX.
//
upx {
// Enables or disables UPX.
// Supported values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
// Defaults to `NEVER`.
//
active = 'ALWAYS'
// Tool version.
//
version = '3.96'
// A list of arguments.
//
arg('-f')
}
//
linux {
// A list of arguments.
//
arg('--static')
}
//
windows {
// A list of arguments.
//
arg('--foo')
}
//
osx {
// A list of arguments.
//
arg('--bar')
}
// The executable JAR that contains the application.
//
mainJar {
path = 'path/to/app.jar'
}
// Defines a list of additional JARs as globs.
//
jars {
// The pattern to use.
// May use glob or regex pattern syntax.
//
pattern = 'path/to/**/*.jar'
}
//
java {
// Name of main module (if any).
// Define only if the application is modular.
//
mainModule = 'com.acme.demo'
// The application's entry point.
// If left undefined, will use ${project.java.mainClass}.
//
mainClass = 'com.acme.Main'
// Maven coordinates = groupId.
// If left undefined, will use ${project.java.groupId}.
//
groupId = 'com.acme'
// Maven coordinates = artifactId.
// If left undefined, will use ${project.java.artifactId}.
//
artifactId = 'app'
// The minimum Java version required by consumers to run the application.
// If left undefined, will use ${project.java.version}.
//
version = '8'
// Identifies the project as being member of a multi-project build.
// If left undefined, will use ${project.java.multiProject}.
//
multiProject = false
// Additional properties used when evaluating templates.
// Key will be capitalized and prefixed with `java`, i.e, `javaFoo`.
//
extraProperties.put('foo', 'bar')
}
// Defines a list of additional files as globs.
// These files will be added to the assembled Zip file.
//
files {
// The pattern to use.
// May use glob or regex pattern syntax.
//
pattern = 'path/to/**/*.txt'
}
// Defines a list of additional files as filesets.
// These files will be added to the assembled Zip file.
//
fileSet {
// The input directory to copy files from.
//
input = 'path/to/input/directory'
// The target path inside the archive.
// If left undefined, defaults to the root of the archive.
//
output = 'path/to/archive/entry'
// Fail if the given `input` does not exist.
// Defaults to `true`.
//
failOnMissingInput = false
// A set of files and directory to include.
//
includes = ['name_or_regex']
// A set of files and directory to exclude.
//
excludes = ['name_or_regex']
// Additional properties used when evaluating templates.
// Key will be capitalized and prefixed with `artifact`, i.e, `artifactFoo`.
//
extraProperties.put('foo', 'bar')
}
}
}
}
}
Graal JDKs
The following rules apply when resolving which Graal JDK will be used to generate native image executables:
-
A matching JDK (by platform) will be searched in
graalJdks
. -
If no match is found then the currently executing JDK will be used.
Paths for graalJdks
must exist in the file system. You may use the
jdks-maven-plugin or
jdks-gradle-plugin to download required JDKs.
UPX
Executables may optionally be compressed with UPX. You must define a version. JReleaser will check if a matching binary exists in the system or download a binary that matches the current platform.