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 {