diff --git a/core/processor/src/main/java/io/quarkus/annotation/processor/documentation/config/scanner/ConfigAnnotationScanner.java b/core/processor/src/main/java/io/quarkus/annotation/processor/documentation/config/scanner/ConfigAnnotationScanner.java index 7618489e6326d..5ae2110b70d55 100644 --- a/core/processor/src/main/java/io/quarkus/annotation/processor/documentation/config/scanner/ConfigAnnotationScanner.java +++ b/core/processor/src/main/java/io/quarkus/annotation/processor/documentation/config/scanner/ConfigAnnotationScanner.java @@ -193,9 +193,7 @@ private void scanElement(List listeners, DiscoveryRoot debug("Detected superinterface: " + superInterfaceTypeElement, clazz); applyListeners(listeners, l -> l.onInterface(configRootElement, superInterfaceTypeElement)); - if (!isConfigRootAlreadyHandled(superInterfaceTypeElement)) { - scanElement(listeners, configRootElement, superInterfaceTypeElement); - } + scanElement(listeners, configRootElement, superInterfaceTypeElement); } } else { TypeMirror superclass = clazz.getSuperclass(); @@ -205,9 +203,7 @@ private void scanElement(List listeners, DiscoveryRoot debug("Detected superclass: " + superclassTypeElement, clazz); applyListeners(listeners, l -> l.onSuperclass(configRootElement, clazz)); - if (!isConfigRootAlreadyHandled(superclassTypeElement)) { - scanElement(listeners, configRootElement, superclassTypeElement); - } + scanElement(listeners, configRootElement, superclassTypeElement); } } @@ -263,6 +259,17 @@ private void scanElement(List listeners, DiscoveryRoot if (resolvedType.isEnum()) { handleEnum(listeners, resolvedType.unwrappedTypeElement()); + } else if (resolvedType.isClass()) { + TypeElement unwrappedTypeElement = resolvedType.unwrappedTypeElement(); + if (utils.element().isAnnotationPresent(unwrappedTypeElement, Types.ANNOTATION_CONFIG_GROUP) + && !isConfigGroupAlreadyHandled(unwrappedTypeElement)) { + debug("Detected config group: " + resolvedType + " on field: " + + field, clazz); + + DiscoveryConfigGroup discoveryConfigGroup = applyRootListeners( + l -> l.onConfigGroup(unwrappedTypeElement)); + scanElement(listeners, discoveryConfigGroup, unwrappedTypeElement); + } } debug("Detected enclosed field: " + field, clazz);