Package io.quarkus.deployment.pkg
Interface NativeConfig
Native executables
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
static enum
Supported Builder Image providers/distributionsstatic interface
static interface
static enum
static enum
static interface
-
Method Summary
Modifier and TypeMethodDescriptionboolean
If all character sets should be added to the native executable.Comma-separated, additional arguments to pass to the build process.boolean
Configuration files generated by the Quarkus build, using native image agent, are informative by default.boolean
If all META-INF/services entries should be automatically registeredConfiguration related to the builder image, when performing native builds in a container.boolean
Deprecated.Since GraalVM 20.2.0 the native image server has become an experimental feature and is disabled by default.Configure native executable compression using UPX.If this build should be done using a container runtime.The container runtime (e.g.Options to pass to the container runtimedebug()
Debugging options.boolean
If the native image build should wait for a debugger to be attached before running.boolean
If the bytecode of all proxies should be dumped for inspectionboolean
Deprecated.--enable-all-security-services
was removed in GraalVM 21.1 https://github.com/oracle/graal/pull/3258boolean
enabled()
Set to enable native-image building using GraalVM.boolean
Generate the report files for GraalVM Dashboard.boolean
If a JVM based 'fallback image' should be created if native image fails.boolean
If the HTTPS url handler should be enabled, allowing you to do URL.openConnection() for HTTPS URLsboolean
If the HTTP url handler should be enabled, allowing you to do URL.openConnection() for HTTP URLsboolean
If isolates should be enabledboolean
Deprecated.JNI is always enabled starting from GraalVM 19.3.1.boolean
If the reports on call paths and included packages/classes/methods should be generatedboolean
Deprecated.This used to be the default prior to GraalVM 20.2.0 and this configuration item was used to disable it as it was not stable.boolean
Deprecated.Usequarkus.native.monitoring
instead.@WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) String
Defines the file encoding as in-Dfile.encoding=...
.boolean
Deprecated.GraalVM 23.1+ will always build with full stack traces.The location of the Graal distributionboolean
headless()
The default value for java.awt.headless JVM option.boolean
Include a reasons entries in the generated json configuration files.boolean
Deprecated.inlineBeforeAnalysis is always enabled starting from GraalVM 21.3.default boolean
javaHome()
The location of the JDKmarch()
Generate instructions for a specific machine type.Enable monitoring various monitoring options.The maximum Java heap to be used during the native image generationpie()
Explicit configuration option to generate a native Position Independent Executable (PIE) for Linux.boolean
If the debug port should be published when building with docker and debug-build-process is trueboolean
If this build is done using a remote docker daemon.boolean
If errors should be reported at runtime.boolean
If exceptions should be reported with a full stack traceBuild time configuration options for resources inclusion in the native executable.boolean
Don't build a native image if it already exists.boolean
Set to prevent the native-image process from actually building the native image.@WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) Optional<String>
Deprecated.Use the global quarkus.default-locale.@WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) Optional<String>
Deprecated.Use the global quarkus.default-locale.
-
Method Details
-
enabled
@WithDefault("false") boolean enabled()Set to enable native-image building using GraalVM. -
sourcesOnly
@WithDefault("false") boolean sourcesOnly()Set to prevent the native-image process from actually building the native image. -
additionalBuildArgs
Comma-separated, additional arguments to pass to the build process. If an argument includes the,
symbol, it needs to be escaped, e.g.\\,
-
enableHttpUrlHandler
@WithDefault("true") boolean enableHttpUrlHandler()If the HTTP url handler should be enabled, allowing you to do URL.openConnection() for HTTP URLs -
enableHttpsUrlHandler
@WithDefault("false") boolean enableHttpsUrlHandler()If the HTTPS url handler should be enabled, allowing you to do URL.openConnection() for HTTPS URLs -
enableAllSecurityServices
Deprecated.--enable-all-security-services
was removed in GraalVM 21.1 https://github.com/oracle/graal/pull/3258If all security services should be added to the native image -
inlineBeforeAnalysis
Deprecated.inlineBeforeAnalysis is always enabled starting from GraalVM 21.3.If-H:+InlineBeforeAnalysis
flag will be added to the native-image run -
enableJni
Deprecated.JNI is always enabled starting from GraalVM 19.3.1. -
headless
@WithDefault("true") boolean headless()The default value for java.awt.headless JVM option. Switching this option affects linking of awt libraries. -
userLanguage
@WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) @Deprecated @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) Optional<String> userLanguage()Deprecated.Use the global quarkus.default-locale.Defines the user language used for building the native executable. It also serves as the default Locale language for the native executable application runtime. e.g. en or cs as defined by IETF BCP 47 language tags. -
userCountry
@WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) @Deprecated @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) Optional<String> userCountry()Deprecated.Use the global quarkus.default-locale.Defines the user country used for building the native executable. It also serves as the default Locale country for the native executable application runtime. e.g. US or FR as defined by ISO 3166-1 alpha-2 codes. -
fileEncoding
@WithDefault("UTF-8") @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) @WithConverter(io.quarkus.runtime.configuration.TrimmedStringConverter.class) String fileEncoding()Defines the file encoding as in-Dfile.encoding=...
. Native image runtime uses the host's (i.e. build time) value offile.encoding
system property. We intentionally default this to UTF-8 to avoid platform specific defaults to be picked up which can then result in inconsistent behavior in the generated native executable. -
addAllCharsets
@WithDefault("false") boolean addAllCharsets()If all character sets should be added to the native executable.Note that some extensions (e.g. the Oracle JDBC driver) also take this setting into account to enable support for all charsets at the extension level.
This increases image size.
-
graalvmHome
The location of the Graal distribution -
javaHome
The location of the JDK -
nativeImageXmx
The maximum Java heap to be used during the native image generation -
debugBuildProcess
@WithDefault("false") boolean debugBuildProcess()If the native image build should wait for a debugger to be attached before running. This is an advanced option and is generally only intended for those familiar with GraalVM internals -
publishDebugBuildProcessPort
@WithDefault("true") boolean publishDebugBuildProcessPort()If the debug port should be published when building with docker and debug-build-process is true -
cleanupServer
Deprecated.Since GraalVM 20.2.0 the native image server has become an experimental feature and is disabled by default.If the native image server should be restarted. -
enableIsolates
@WithDefault("true") boolean enableIsolates()If isolates should be enabled -
enableFallbackImages
@WithDefault("false") boolean enableFallbackImages()If a JVM based 'fallback image' should be created if native image fails. This is not recommended, as this is functionally the same as just running the application in a JVM -
enableServer
Deprecated.This used to be the default prior to GraalVM 20.2.0 and this configuration item was used to disable it as it was not stable. Since GraalVM 20.2.0 the native image server has become an experimental feature.If the native image server should be used. This can speed up compilation but can result in changes not always being picked up due to cache invalidation not working 100% -
autoServiceLoaderRegistration
@WithDefault("false") boolean autoServiceLoaderRegistration()If all META-INF/services entries should be automatically registered -
dumpProxies
@WithDefault("false") boolean dumpProxies()If the bytecode of all proxies should be dumped for inspection -
containerBuild
If this build should be done using a container runtime. Unless container-runtime is also set, docker will be used by default. If docker is not available or is an alias to podman, podman will be used instead as the default. -
pie
Explicit configuration option to generate a native Position Independent Executable (PIE) for Linux. If the system supports PIE generation, the default behaviour is to disable it for performance reasons. However, some systems can only run position-independent executables, so this option enables the generation of such native executables. -
march
Generate instructions for a specific machine type. Defaults tox86-64-v3
on AMD64 andarmv8-a
on AArch64. Usecompatibility
for best compatibility, ornative
for best performance if a native executable is deployed on the same machine or on a machine with the same CPU features. A list of all available machine types is available by executingnative-image -march=list
-
remoteContainerBuild
@WithDefault("false") boolean remoteContainerBuild()If this build is done using a remote docker daemon. -
isExplicitContainerBuild
default boolean isExplicitContainerBuild() -
builderImage
NativeConfig.BuilderImageConfig builderImage()Configuration related to the builder image, when performing native builds in a container. -
containerRuntime
Optional<ContainerRuntimeUtil.ContainerRuntime> containerRuntime()The container runtime (e.g. docker) that is used to do an image based build. If this is set then a container build is always done. -
containerRuntimeOptions
Options to pass to the container runtime -
enableVmInspection
Deprecated.Usequarkus.native.monitoring
instead.If the resulting image should allow VM introspection. -
monitoring
Optional<List<NativeConfig.MonitoringOption>> monitoring()Enable monitoring various monitoring options. The value should be comma separated.jfr
for JDK flight recorder supportjvmstat
for JVMStat supportheapdump
for heampdump supportjmxclient
for JMX client support (experimental)jmxserver
for JMX server support (experimental)all
for all monitoring features
-
fullStackTraces
Deprecated.GraalVM 23.1+ will always build with full stack traces.If full stack traces are enabled in the resulting image -
enableReports
@WithDefault("false") boolean enableReports()If the reports on call paths and included packages/classes/methods should be generated -
reportExceptionStackTraces
@WithDefault("true") boolean reportExceptionStackTraces()If exceptions should be reported with a full stack trace -
reportErrorsAtRuntime
@WithDefault("false") boolean reportErrorsAtRuntime()If errors should be reported at runtime. This is a more relaxed setting, however it is not recommended as it means your application may fail at runtime if an unsupported feature is used by accident. Note that the use of this flag may result in build time failures due toClassNotFoundException
s. Reason most likely being that the Quarkus extension already optimized it away or do not actually need it. In such cases you should explicitly add the corresponding dependency providing the missing classes as a dependency to your project. -
reuseExisting
@WithDefault("false") boolean reuseExisting()Don't build a native image if it already exists. This is useful if you have already built an image and you want to use Quarkus to deploy it somewhere. Note that this is not able to detect if the existing image is outdated, if you have modified source or config and want a new image you must not use this flag. -
resources
NativeConfig.ResourcesConfig resources()Build time configuration options for resources inclusion in the native executable. -
debug
NativeConfig.Debug debug()Debugging options. -
enableDashboardDump
@WithDefault("false") boolean enableDashboardDump()Generate the report files for GraalVM Dashboard. -
includeReasonsInConfigFiles
@WithDefault("false") boolean includeReasonsInConfigFiles()Include a reasons entries in the generated json configuration files. -
compression
NativeConfig.Compression compression()Configure native executable compression using UPX. -
agentConfigurationApply
@WithDefault("false") boolean agentConfigurationApply()Configuration files generated by the Quarkus build, using native image agent, are informative by default. In other words, the generated configuration files are presented in the build log but are not applied. When this option is set to true, generated configuration files are applied to the native executable building process.Enabling this option should be done with care, because it can make native image configuration and/or behaviour dependant on other non-obvious factors. For example, if the native image agent generated configuration was generated from running JVM unit tests, disabling test(s) can result in a different native image configuration being generated, which in turn can misconfigure the native executable or affect its behaviour in unintended ways.
-