Class ArcConfig
- java.lang.Object
-
- io.quarkus.arc.deployment.ArcConfig
-
@ConfigRoot(phase=BUILD_TIME) public class ArcConfig extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static Set<String>
ALLOWED_REMOVE_UNUSED_BEANS_VALUES
boolean
autoInjectFields
If set to true@Inject
is automatically added to all non-static non-final fields that are annotated with one of the annotations defined byAutoInjectAnnotationBuildItem
.boolean
autoProducerMethods
If set to true thenjakarta.enterprise.inject.Produces
is automatically added to all non-void methods that are annotated with a scope annotation, a stereotype or a qualifier, and are not annotated withInject
orProduces
, and no parameter is annotated withDisposes
,Observes
orObservesAsync
.ArcContextPropagationConfig
contextPropagation
Context propagation configuration.boolean
detectUnusedFalsePositives
If set to true then the container attempts to detect "unused removed beans" false positives during programmatic lookup at runtime.boolean
detectWrongAnnotations
If set to true then the container attempts to detect wrong usages of annotations and eventually fails the build to prevent unexpected behavior of a Quarkus application.ArcDevModeConfig
devMode
Dev mode configuration.(package private) Map<String,IndexDependencyConfig>
excludeDependency
Artifacts that should be excluded from discovery.Optional<List<String>>
excludeTypes
The list of types that should be excluded from discovery.boolean
failOnInterceptedPrivateMethod
If set to true (the default), the build fails if a private method that is neither an observer nor a producer, is annotated with an interceptor binding.Optional<List<String>>
ignoredSplitPackages
The list of packages that will not be checked for split package issues.String
removeUnusedBeans
If set toall
(ortrue
) the container will attempt to remove all unused beans. If set tonone
(orfalse
) no beans will ever be removed even if they are unused (according to the criteria set out below) If set tofwk
, then all unused beans will be removed, except the unused beans whose classes are declared in the application codeOptional<List<String>>
selectedAlternatives
The list of selected alternatives for an application.boolean
strictCompatibility
If set totrue
, the container will perform additional validations mandated by the CDI specification.ArcTestConfig
test
Test mode configuration.boolean
transformPrivateInjectedFields
If set to true, the bytecode of private fields that are injection points will be transformed to package private.boolean
transformUnproxyableClasses
If set to true, the bytecode of unproxyable beans will be transformed.Optional<List<String>>
unremovableTypes
List of types that should be considered unremovable regardless of whether they are directly used or not.
-
Constructor Summary
Constructors Constructor Description ArcConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isRemoveUnusedBeansFieldValid()
boolean
shouldEnableBeanRemoval()
boolean
shouldOnlyKeepAppBeans()
-
-
-
Field Detail
-
ALLOWED_REMOVE_UNUSED_BEANS_VALUES
public static final Set<String> ALLOWED_REMOVE_UNUSED_BEANS_VALUES
-
removeUnusedBeans
@ConfigItem(defaultValue="all") public String removeUnusedBeans
- If set to
all
(ortrue
) the container will attempt to remove all unused beans. - If set to
none
(orfalse
) no beans will ever be removed even if they are unused (according to the criteria set out below) - If set to
fwk
, then all unused beans will be removed, except the unused beans whose classes are declared in the application code
An unused bean:
- is not a built-in bean or interceptor,
- is not eligible for injection to any injection point,
- is not excluded by any extension,
- does not have a name,
- does not declare an observer,
- does not declare any producer which is eligible for injection to any injection point,
- is not directly eligible for injection into any
Instance
injection point
- See Also:
UnremovableBeanBuildItem
- If set to
-
autoInjectFields
@ConfigItem(defaultValue="true") public boolean autoInjectFields
If set to true@Inject
is automatically added to all non-static non-final fields that are annotated with one of the annotations defined byAutoInjectAnnotationBuildItem
.
-
transformUnproxyableClasses
@ConfigItem(defaultValue="true") public boolean transformUnproxyableClasses
If set to true, the bytecode of unproxyable beans will be transformed. This ensures that a proxy/subclass can be created properly. If the value is set to false, then an exception is thrown at build time indicating that a subclass/proxy could not be created. Quarkus performs the following transformations when this setting is enabled:- Remove 'final' modifier from classes and methods when a proxy is required.
- Create a no-args constructor if needed.
- Makes private no-args constructors package-private if necessary.
-
transformPrivateInjectedFields
@ConfigItem(defaultValue="true") public boolean transformPrivateInjectedFields
If set to true, the bytecode of private fields that are injection points will be transformed to package private. This ensures that field injection can be performed completely reflection-free. If the value is set to false, then a reflection fallback is used to perform the injection.
-
failOnInterceptedPrivateMethod
@ConfigItem(defaultValue="true") public boolean failOnInterceptedPrivateMethod
If set to true (the default), the build fails if a private method that is neither an observer nor a producer, is annotated with an interceptor binding. An example of this is the use ofTransactional
on a private method of a bean. If set to false, Quarkus simply logs a warning that the annotation will be ignored.
-
selectedAlternatives
@ConfigItem public Optional<List<String>> selectedAlternatives
The list of selected alternatives for an application.An element value can be:
- a fully qualified class name, i.e.
org.acme.Foo
- a simple class name as defined by
Class.getSimpleName()
, i.e.Foo
- a package name with suffix
.*
, i.e.org.acme.*
, matches a package - a package name with suffix
.**
, i.e.org.acme.**
, matches a package that starts with the value
Integer.MAX_VALUE
is used for the relevant bean. The priority declared viaPriority
is overridden. - a fully qualified class name, i.e.
-
autoProducerMethods
@ConfigItem(defaultValue="true") public boolean autoProducerMethods
If set to true thenjakarta.enterprise.inject.Produces
is automatically added to all non-void methods that are annotated with a scope annotation, a stereotype or a qualifier, and are not annotated withInject
orProduces
, and no parameter is annotated withDisposes
,Observes
orObservesAsync
.
-
excludeTypes
@ConfigItem public Optional<List<String>> excludeTypes
The list of types that should be excluded from discovery.An element value can be:
- a fully qualified class name, i.e.
org.acme.Foo
- a simple class name as defined by
Class.getSimpleName()
, i.e.Foo
- a package name with suffix
.*
, i.e.org.acme.*
, matches a package - a package name with suffix
.**
, i.e.org.acme.**
, matches a package that starts with the value
- a fully qualified class name, i.e.
-
unremovableTypes
@ConfigItem public Optional<List<String>> unremovableTypes
List of types that should be considered unremovable regardless of whether they are directly used or not. This is a configuration option equivalent to usingUnremovable
annotation.An element value can be:
- a fully qualified class name, i.e.
org.acme.Foo
- a simple class name as defined by
Class.getSimpleName()
, i.e.Foo
- a package name with suffix
.*
, i.e.org.acme.*
, matches a package - a package name with suffix
.**
, i.e.org.acme.**
, matches a package that starts with the value
- a fully qualified class name, i.e.
-
excludeDependency
@ConfigItem @ConfigDocSection @ConfigDocMapKey("dependency-name") Map<String,IndexDependencyConfig> excludeDependency
Artifacts that should be excluded from discovery.These artifacts would be otherwise scanned for beans, i.e. they contain a Jandex index or a beans.xml descriptor.
-
detectUnusedFalsePositives
@ConfigItem(defaultValue="true") public boolean detectUnusedFalsePositives
If set to true then the container attempts to detect "unused removed beans" false positives during programmatic lookup at runtime. You can disable this feature to conserve some memory when running your application in production.- See Also:
removeUnusedBeans
-
detectWrongAnnotations
@ConfigItem(defaultValue="true") public boolean detectWrongAnnotations
If set to true then the container attempts to detect wrong usages of annotations and eventually fails the build to prevent unexpected behavior of a Quarkus application.A typical example is
@jakarta.ejb.Singleton
which is often confused with@jakarta.inject.Singleton
. As a result a component annotated with@jakarta.ejb.Singleton
would be completely ignored. Another example is an inner class annotated with a scope annotation - this component would be again completely ignored.
-
strictCompatibility
@ConfigItem(defaultValue="false") public boolean strictCompatibility
If set totrue
, the container will perform additional validations mandated by the CDI specification. Some improvements on top of the CDI specification may be disabled. Applications that work as expected in the strict mode should work without a change in the default, non-strict mode.The strict mode is mainly introduced to allow passing the CDI Lite TCK. Applications are recommended to use the default, non-strict mode, which makes CDI more convenient to use. The "strictness" of the strict mode (the set of additional validations and the set of disabled improvements on top of the CDI specification) may change over time.
Note that
transformUnproxyableClasses
andremoveUnusedBeans
also has effect on specification compatibility. You may want to disable these features to get behavior closer to the specification.
-
devMode
@ConfigItem public ArcDevModeConfig devMode
Dev mode configuration.
-
test
@ConfigItem public ArcTestConfig test
Test mode configuration.
-
ignoredSplitPackages
@ConfigItem public Optional<List<String>> ignoredSplitPackages
The list of packages that will not be checked for split package issues.A package string representation can be:
- a full name of the package, i.e.
org.acme.foo
- a package name with suffix
.*
, i.e.org.acme.*
, which matches a package that starts with provided value
- a full name of the package, i.e.
-
contextPropagation
@ConfigItem public ArcContextPropagationConfig contextPropagation
Context propagation configuration.
-
-