From ae4ca4b6eb16d6710ef911e68f44c2bb48e28236 Mon Sep 17 00:00:00 2001 From: david-leifker <114954101+david-leifker@users.noreply.github.com> Date: Mon, 1 Jul 2024 10:32:01 -0500 Subject: [PATCH] fix(plugin): include ancestors when loading Spring custom plugin (#10809) --- .../datahub/plugins/metadata/aspect/SpringPluginFactory.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/metadata-service/plugin/src/main/java/com/datahub/plugins/metadata/aspect/SpringPluginFactory.java b/metadata-service/plugin/src/main/java/com/datahub/plugins/metadata/aspect/SpringPluginFactory.java index dcedbec50b793..043b0016abaaa 100644 --- a/metadata-service/plugin/src/main/java/com/datahub/plugins/metadata/aspect/SpringPluginFactory.java +++ b/metadata-service/plugin/src/main/java/com/datahub/plugins/metadata/aspect/SpringPluginFactory.java @@ -14,6 +14,7 @@ import javax.annotation.Nonnull; import javax.annotation.Nullable; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.BeanFactoryUtils; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.AnnotationConfigApplicationContext; @@ -109,7 +110,9 @@ protected List build( final List plugins; if (config.getSpring().getName() == null) { plugins = - springApplicationContext.getBeansOfType(clazz).values().stream() + BeanFactoryUtils.beansOfTypeIncludingAncestors(springApplicationContext, clazz) + .values() + .stream() .map(plugin -> (T) plugin) .collect(Collectors.toList()); } else {