quarkusio/quarkus · error · IllegalArgumentException
Invalid configuration value set for 'quarkus.arc.remove-unus
Error message
Invalid configuration value set for 'quarkus.arc.remove-unused-beans'. Please use one of all, true, false
What it means
The ArcProcessor validates the quarkus.arc.remove-unused-beans config property at build time. Only 'all', 'true' and 'false' are accepted; any other value fails application startup during augmentation with IllegalArgumentException.
Source
Thrown at extensions/arc/deployment/src/main/java/io/quarkus/arc/deployment/ArcProcessor.java:182
List<AnnotationsTransformerBuildItem> annotationTransformers,
List<InjectionPointTransformerBuildItem> injectionPointTransformers,
List<ObserverTransformerBuildItem> observerTransformers,
List<InterceptorBindingRegistrarBuildItem> interceptorBindingRegistrars,
List<QualifierRegistrarBuildItem> qualifierRegistrars,
List<StereotypeRegistrarBuildItem> stereotypeRegistrars,
List<ApplicationClassPredicateBuildItem> applicationClassPredicates,
List<AdditionalBeanBuildItem> additionalBeans,
List<ResourceAnnotationBuildItem> resourceAnnotations,
List<BeanDefiningAnnotationBuildItem> additionalBeanDefiningAnnotations,
List<SuppressConditionGeneratorBuildItem> suppressConditionGenerators,
Optional<TestClassPredicateBuildItem> testClassPredicate,
Capabilities capabilities,
CustomScopeAnnotationsBuildItem customScopes,
LaunchModeBuildItem launchModeBuildItem,
BuildProducer<CompletedApplicationClassPredicateBuildItem> applicationClassPredicateProducer) {
if (!arcConfig.isRemoveUnusedBeansFieldValid()) {
throw new IllegalArgumentException("Invalid configuration value set for 'quarkus.arc.remove-unused-beans'." +
" Please use one of " + ArcConfig.ALLOWED_REMOVE_UNUSED_BEANS_VALUES);
}
// bean type -> default scope (may be null)
Map<String, DotName> additionalBeanTypes = new HashMap<>();
for (AdditionalBeanBuildItem additionalBean : additionalBeans) {
DotName defaultScope = additionalBean.getDefaultScope();
for (String beanClass : additionalBean.getBeanClasses()) {
DotName existingDefaultScope = additionalBeanTypes.get(beanClass);
if (existingDefaultScope != null && defaultScope != null && !existingDefaultScope.equals(defaultScope)) {
throw new IllegalStateException("Different default scopes defined for additional bean class: " + beanClass
+ "\n\t - scopes: " + defaultScope + " and "
+ existingDefaultScope);
}
additionalBeanTypes.put(beanClass, defaultScope);
}
}
View on GitHub (pinned to e1c734241f)
Solutions
- Set the property to one of: all, true, false
- Remove the property entirely if unused-bean removal is not needed
- Check the resolved value with quarkus:dev config dump or quarkus.log.category lookup to find where it is set
Example fix
// before quarkus.arc.remove-unused-beans=none // after quarkus.arc.remove-unused-beans=all
Defensive patterns
Strategy: validation
Validate before calling
Set<String> allowed = Set.of("all", "true", "false");
String v = System.getProperty("quarkus.arc.remove-unused-beans", "");
if (!v.isEmpty() && !allowed.contains(v)) throw new IllegalArgumentException("quarkus.arc.remove-unused-beans must be one of " + allowed); Prevention
- Validate app config in CI before augmentation
- Grep application.properties and env vars for the property
- Stick to documented values only
When it happens
Trigger: Setting quarkus.arc.remove-unused-beans to anything other than all, true, or false (e.g. 'none', 'junk', a typo, or a quoted/whitespace-laden value) in application.properties or via env vars/CLI.
Common situations: Config typos like remove-unused-beans=none; copying old values from deprecated configs; env var QUARKUS_ARC_REMOVE_UNUSED_BEANS set incorrectly in CI.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- The configuration ${clazz} is missing the @ConfigRoot annota
- AnnotationTransformation is not an AnnotationsTransformer: <
- Different default scopes defined for additional bean class:
- Unexpected value: <arcConfig.optimizeContexts()>
- A matching predicate must be set!
AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05).
Data as JSON: /api/errors/3d1c8ca804d5066b.
Report an issue: GitHub.