Will the introduction of a starter in SpringBoot load all AutoConfig classes into the container?

when I introduce spring-boot-starter-web, I will introduce spring-boot-autoconfigure "s jar package. Spring is to scan the contents of the spring.factories file under the META-INF of all jar packages under the project and then add the automatic configuration class to the container, so whether all the automatic configuration classes will be added to the container? if so, will it be wasteful? if not where the loading place is selected. Mengxin asked the boss for an explanation.

Jul.30,2021

you can choose to exclude classes that you do not want to configure automatically, by annotating or configuring properties

@Configuration
@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
public class MyConfiguration {
}

or exclude configuration classes that you do not want to load through the spring.autoconfigure.exclude attribute in the configuration file.


well, thank you for your answer. I have learned this method of exclusion. I am still a little confused that any starter will introduce all the automatic configuration classes of spring-boot-autoconfigure and load them into the spring container. For example, only the starter of web will load the automatic configuration classes of SpringCloud under spring-boot-autoconfigure, right? am I right? or when SpringBoot loads the classes of these configurations, starter, without SpringCloud will not load the automatic configuration of SpringCloud into the Spring container.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3ae40-407d8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3ae40-407d8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?