From ab2e936210e1b340941dd32449098191c17cd82e Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Wed, 28 Aug 2024 14:26:29 +0200 Subject: [PATCH] Config Doc - Scan config groups that are outside of the module For traditional config roots, we also need to scan the potential config groups that are not in this module. Fixes #42815 --- .../config/scanner/ConfigAnnotationScanner.java | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 08a06fbe24f3e0..5ae2110b70d557 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 @@ -259,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);