I have the following requirements while loading an autoconfiguration (via @EnableAutoConfiguration
and spring.factories
:
The only options I can think off are:
@Profile
annotation on the autoconfiguration But both options require modifying the autoconfiguration starter jars, which I prefer not to.
Is there a way to achieve this?
这全都与@ComponentScan有关,您将需要为2个配置文件进行2个父级自动配置,一个使用@ComponentScan并带有包含您的其他子级自动配置的软件包,另一个用于排除您不需要的自动配置。此配置文件,如果要扫描除此自动配置以外的包括此自动配置的软件包,可以使用excludeFilters
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.