Class PackageConfig
- java.lang.Object
-
- io.quarkus.deployment.pkg.PackageConfig
-
@ConfigRoot public class PackageConfig extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PackageConfig.BuiltInType
static class
PackageConfig.QuiltFlowerConfig
-
Field Summary
Fields Modifier and Type Field Description boolean
addRunnerSuffix
Indicates whether the generated binary file (uber-jar or native image) should have the runner suffix appended.Optional<String>
appcdsBuilderImage
When AppCDS generation is enabled, if this property is set, then the JVM used to generate the AppCDS file will be the JVM present in the container image.boolean
appcdsUseContainer
Whether creation of the AppCDS archive should run in a container if available.boolean
createAppcds
Whether to automate the creation of AppCDS.static String
FAST_JAR
Deprecated.UsePackageConfig.BuiltInType.FAST_JAR
insteadboolean
filterOptionalDependencies
Flag indicating whether the optional dependencies should be filtered out or not.boolean
includeDependencyList
This option only applies when using fast-jar or mutable-jar.Optional<Set<String>>
includedOptionalDependencies
List of all the dependencies that have been defined as optional to include into the final package of the application.static String
JAR
Deprecated.UsePackageConfig.BuiltInType.JAR
insteadstatic String
LEGACY
Deprecated.use 'legacy-jar' insteadstatic String
LEGACY_JAR
Deprecated.UsePackageConfig.BuiltInType.LEGACY_JAR
insteadOptional<String>
mainClass
The entry point of the application.ManifestConfig
manifest
Manifest configuration of the runner jar.static String
MUTABLE_JAR
Deprecated.UsePackageConfig.BuiltInType.MUTABLE_JAR
insteadstatic String
NATIVE
Deprecated.UsePackageConfig.BuiltInType.NATIVE
insteadstatic String
NATIVE_SOURCES
Deprecated.UsePackageConfig.BuiltInType.NATIVE_SOURCES
insteadOptional<String>
outputDirectory
The output folder in which to place the output, this is resolved relative to the build systems target directory.Optional<String>
outputName
The name of the final artifactPackageConfig.QuiltFlowerConfig
quiltflower
Quiltflower Decompiler configurationString
runnerSuffix
The suffix that is applied to the runner jar and native imagesString
type
The requested output type.static String
UBER_JAR
Deprecated.UsePackageConfig.BuiltInType.UBER_JAR
insteadOptional<List<String>>
userConfiguredIgnoredEntries
Files that should not be copied to the output artifactOptional<String>
userProvidersDirectory
This is an advanced option that only takes effect for the mutable-jar format.boolean
writeTransformedBytecodeToBuildOutput
If set totrue
, it will result in the Quarkus writing the transformed application bytecode to the build tool's output directory.
-
Constructor Summary
Constructors Constructor Description PackageConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getRunnerSuffix()
boolean
isAnyJarType()
boolean
isFastJar()
boolean
isLegacyJar()
boolean
isNativeOrNativeSources()
boolean
isUberJar()
-
-
-
Field Detail
-
JAR
@Deprecated public static final String JAR
Deprecated.UsePackageConfig.BuiltInType.JAR
instead
-
UBER_JAR
@Deprecated public static final String UBER_JAR
Deprecated.UsePackageConfig.BuiltInType.UBER_JAR
instead
-
FAST_JAR
@Deprecated public static final String FAST_JAR
Deprecated.UsePackageConfig.BuiltInType.FAST_JAR
instead
-
MUTABLE_JAR
@Deprecated public static final String MUTABLE_JAR
Deprecated.UsePackageConfig.BuiltInType.MUTABLE_JAR
instead
-
LEGACY
@Deprecated public static final String LEGACY
Deprecated.use 'legacy-jar' instead
-
LEGACY_JAR
@Deprecated public static final String LEGACY_JAR
Deprecated.UsePackageConfig.BuiltInType.LEGACY_JAR
instead
-
NATIVE
@Deprecated public static final String NATIVE
Deprecated.UsePackageConfig.BuiltInType.NATIVE
instead
-
NATIVE_SOURCES
@Deprecated public static final String NATIVE_SOURCES
Deprecated.UsePackageConfig.BuiltInType.NATIVE_SOURCES
instead
-
type
@ConfigItem(defaultValue="jar") public String type
The requested output type.The default built in types are 'jar' (which will use 'fast-jar'), 'legacy-jar' for the pre-1.12 default jar packaging, 'uber-jar', 'mutable-jar' (for remote development mode), 'native' and 'native-sources'.
-
manifest
@ConfigItem public ManifestConfig manifest
Manifest configuration of the runner jar.
-
mainClass
@ConfigItem public Optional<String> mainClass
The entry point of the application. This can either be a fully qualified name of a standard Java class with a main method, orQuarkusApplication
.If your application has main classes annotated with
QuarkusMain
then this can also reference the name given in the annotation, to avoid the need to specify fully qualified names in the config.
-
userConfiguredIgnoredEntries
@ConfigItem public Optional<List<String>> userConfiguredIgnoredEntries
Files that should not be copied to the output artifact
-
includedOptionalDependencies
@ConfigItem public Optional<Set<String>> includedOptionalDependencies
List of all the dependencies that have been defined as optional to include into the final package of the application. Each optional dependency needs to be expressed in the following format:groupId:artifactId:classifier:type
With the classifier and type being optional.
If the type is missing, the artifact is assumed to be of type
jar
.This parameter is optional, if absent, no optional dependencies will be included into the final package of the application.
For backward compatibility reasons, this parameter is ignored by default and can be enabled by setting the parameter
quarkus.package.filter-optional-dependencies
totrue
.This parameter is meant to be used in modules where multi-builds have been configured to avoid getting a final package with unused dependencies.
-
filterOptionalDependencies
@ConfigItem(defaultValue="false") public boolean filterOptionalDependencies
Flag indicating whether the optional dependencies should be filtered out or not.This parameter is meant to be used in modules where multi-builds have been configured to avoid getting a final package with unused dependencies.
-
runnerSuffix
@ConfigItem(defaultValue="-runner") public String runnerSuffix
The suffix that is applied to the runner jar and native images
-
addRunnerSuffix
@ConfigItem(defaultValue="true") public boolean addRunnerSuffix
Indicates whether the generated binary file (uber-jar or native image) should have the runner suffix appended. Turning off the runner suffix in case of the uber-jar package type, the original build system (Maven, Gradle, etc) built JAR will be replaced with the Quarkus built uber JAR.
-
outputDirectory
@ConfigItem public Optional<String> outputDirectory
The output folder in which to place the output, this is resolved relative to the build systems target directory.
-
outputName
@ConfigItem public Optional<String> outputName
The name of the final artifact
-
createAppcds
@ConfigItem public boolean createAppcds
Whether to automate the creation of AppCDS. This has no effect when a native binary is needed and will be ignored in that case. Furthermore, this option only works for Java 11+ and is considered experimental for the time being. Finally, care must be taken to use the same exact JVM version when building and running the application.
-
appcdsBuilderImage
@ConfigItem public Optional<String> appcdsBuilderImage
When AppCDS generation is enabled, if this property is set, then the JVM used to generate the AppCDS file will be the JVM present in the container image. The builder image is expected to have the 'java' binary on its PATH. This flag is useful when the JVM to be used at runtime is not the same exact JVM version as the one used to build the jar. Note that this property is consulted only whenquarkus.package.create-appcds=true
and it requires having docker available during the build.
-
appcdsUseContainer
@ConfigItem(defaultValue="true") public boolean appcdsUseContainer
Whether creation of the AppCDS archive should run in a container if available.Normally, if either a suitable container image to create the AppCDS archive inside of can be determined automatically or if one is explicitly set using the
quarkus.package.appcds-builder-image
setting, the AppCDS archive is generated by running the JDK contained in the image as a container.If this option is set to
false
, a container will not be used to generate the AppCDS archive. Instead, the JDK used to build the application is also used to create the archive. Note that the exact same JDK version must be used to run the application in this case.Ignored if
quarkus.package.create-appcds
is set tofalse
.
-
userProvidersDirectory
@ConfigItem public Optional<String> userProvidersDirectory
This is an advanced option that only takes effect for the mutable-jar format.If this is specified a directory of this name will be created in the jar distribution. Users can place jar files in this directory, and when re-augmentation is performed these will be processed and added to the class-path.
Note that before reaugmentation has been performed these jars will be ignored, and if they are updated the app should be reaugmented again.
-
includeDependencyList
@ConfigItem(defaultValue="true") public boolean includeDependencyList
This option only applies when using fast-jar or mutable-jar. If this option is true then a list of all the coordinates of the artifacts that made up this image will be included in the quarkus-app directory. This list can be used by vulnerability scanners to determine if your application has any vulnerable dependencies.
-
quiltflower
@ConfigItem public PackageConfig.QuiltFlowerConfig quiltflower
Quiltflower Decompiler configuration
-
writeTransformedBytecodeToBuildOutput
@ConfigItem public boolean writeTransformedBytecodeToBuildOutput
If set totrue
, it will result in the Quarkus writing the transformed application bytecode to the build tool's output directory. This is useful for post-build tools that need to scan the application bytecode - for example for offline code-coverage tools. For example, if using Maven, enabling this feature will result in the classes intarget/classes
being updated with the versions that result after Quarkus has applied its transformations. Setting this totrue
however, should be done with a lot of caution and only if subsequent builds are done in a clean environment (i.e. the build tool's output directory has been completely cleaned).
-
-
Method Detail
-
isAnyJarType
public boolean isAnyJarType()
-
isFastJar
public boolean isFastJar()
-
isLegacyJar
public boolean isLegacyJar()
-
isUberJar
public boolean isUberJar()
-
isNativeOrNativeSources
public boolean isNativeOrNativeSources()
-
getRunnerSuffix
public String getRunnerSuffix()
-
-