@@ -66,29 +66,9 @@ public ConfigAnnotationScanner(Config config, Utils utils) {
66
66
List <ConfigAnnotationListener > configRootListeners = new ArrayList <>();
67
67
List <ConfigAnnotationListener > configMappingWithoutConfigRootListeners = new ArrayList <>();
68
68
69
- if (!config .getExtension ().isMixedModule ()) {
70
- // This is what we aim for. We have an exception for Quarkus Core and Quarkus Messaging though.
71
- if (config .useConfigMapping ()) {
72
- configRootListeners .add (new JavadocConfigMappingListener (config , utils , configCollector ));
73
- configRootListeners .add (new ConfigMappingListener (config , utils , configCollector ));
74
-
75
- configMappingWithoutConfigRootListeners .add (new JavadocConfigMappingListener (config , utils , configCollector ));
76
- } else {
77
- configRootListeners .add (new JavadocLegacyConfigRootListener (config , utils , configCollector ));
78
- configRootListeners .add (new LegacyConfigRootListener (config , utils , configCollector ));
79
- }
80
- } else {
81
- // TODO #42114 remove once fixed
82
- // we handle both traditional config roots and config mappings
83
- if (config .getExtension ().isMixedModule ()) {
84
- configRootListeners .add (new JavadocConfigMappingListener (config , utils , configCollector ));
85
- configRootListeners .add (new JavadocLegacyConfigRootListener (config , utils , configCollector ));
86
- configRootListeners .add (new ConfigMappingListener (config , utils , configCollector ));
87
- configRootListeners .add (new LegacyConfigRootListener (config , utils , configCollector ));
88
-
89
- configMappingWithoutConfigRootListeners .add (new JavadocConfigMappingListener (config , utils , configCollector ));
90
- }
91
- }
69
+ configRootListeners .add (new JavadocConfigMappingListener (config , utils , configCollector ));
70
+ configRootListeners .add (new ConfigMappingListener (config , utils , configCollector ));
71
+ configMappingWithoutConfigRootListeners .add (new JavadocConfigMappingListener (config , utils , configCollector ));
92
72
93
73
this .configRootListeners = Collections .unmodifiableList (configRootListeners );
94
74
this .configMappingWithoutConfigRootListeners = Collections .unmodifiableList (configMappingWithoutConfigRootListeners );
@@ -481,28 +461,10 @@ private <T extends DiscoveryRootElement> T applyRootListeners(
481
461
}
482
462
483
463
private void checkConfigRootAnnotationConsistency (TypeElement configRoot ) {
484
- // for now quarkus-core is a mix of both @ConfigRoot and @ConfigMapping
485
- // see https://github.com/quarkusio/quarkus/issues/42114
486
- // same for Quarkus Messaging
487
- // TODO #42114 remove once fixed
488
- if (config .getExtension ().isMixedModule ()) {
489
- return ;
490
- }
491
-
492
- if (config .useConfigMapping ()) {
493
- if (!utils .element ().isAnnotationPresent (configRoot , Types .ANNOTATION_CONFIG_MAPPING )) {
494
- throw new IllegalStateException (
495
- "This module is configured to use @ConfigMapping annotations but we found a @ConfigRoot without a corresponding @ConfigMapping annotation in: "
496
- + configRoot + "."
497
- + " Either add the annotation or add the -AlegacyConfigRoot=true argument to the annotation processor config in the pom.xml" );
498
- }
499
- } else {
500
- if (utils .element ().isAnnotationPresent (configRoot , Types .ANNOTATION_CONFIG_MAPPING )) {
501
- throw new IllegalStateException (
502
- "This module is configured to use legacy @ConfigRoot annotations but we found a @ConfigMapping annotation in: "
503
- + configRoot + "."
504
- + " Check the configuration of the annotation processor and drop the -AlegacyConfigRoot=true argument from the pom.xml if needed" );
505
- }
464
+ if (!utils .element ().isAnnotationPresent (configRoot , Types .ANNOTATION_CONFIG_MAPPING )) {
465
+ throw new IllegalStateException (
466
+ "We found a @ConfigRoot without a corresponding @ConfigMapping annotation in: " + configRoot + "."
467
+ + " Make sure your configuration interfaces are annotated with @ConfigMapping." );
506
468
}
507
469
}
508
470
0 commit comments