diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java index a6a73fcf9b..c9a95a8d1a 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationPackages.java @@ -21,6 +21,7 @@ import java.util.List; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.NoSuchBeanDefinitionException; +import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.GenericBeanDefinition; import org.springframework.context.annotation.ImportBeanDefinitionRegistrar; @@ -64,6 +65,7 @@ public abstract class AutoConfigurationPackages { beanDefinition.setBeanClass(BasePackage.class); beanDefinition.getConstructorArgumentValues().addIndexedArgumentValue(0, packageName); + beanDefinition.setRole(AbstractBeanDefinition.ROLE_INFRASTRUCTURE); registry.registerBeanDefinition(BEAN, beanDefinition); } diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index 6aeaa1d30b..0e3735911b 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -17,7 +17,8 @@ 2.2.1 1.3.175 1.3 - 4.3.0.Final + 4.3.0.Final + ${hibernate.version} 1.0.1.Final 5.0.2.Final 4.3.2 diff --git a/spring-boot/src/main/java/org/springframework/boot/orm/jpa/EntityScanRegistrar.java b/spring-boot/src/main/java/org/springframework/boot/orm/jpa/EntityScanRegistrar.java index 07477ddd8c..013730f408 100644 --- a/spring-boot/src/main/java/org/springframework/boot/orm/jpa/EntityScanRegistrar.java +++ b/spring-boot/src/main/java/org/springframework/boot/orm/jpa/EntityScanRegistrar.java @@ -23,6 +23,7 @@ import java.util.Set; import org.springframework.beans.BeansException; import org.springframework.beans.factory.config.BeanPostProcessor; +import org.springframework.beans.factory.support.AbstractBeanDefinition; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.GenericBeanDefinition; import org.springframework.context.ApplicationListener; @@ -52,6 +53,7 @@ class EntityScanRegistrar implements ImportBeanDefinitionRegistrar { beanDefinition.setBeanClass(EntityScanBeanPostProcessor.class); beanDefinition.getConstructorArgumentValues().addGenericArgumentValue( getPackagesToScan(importingClassMetadata)); + beanDefinition.setRole(AbstractBeanDefinition.ROLE_INFRASTRUCTURE); registry.registerBeanDefinition(BEAN_NAME, beanDefinition); } }