1. spring 文档说明
Many Spring Boot developers always have their main class annotated with @Configuration
, @EnableAutoConfiguration
and @ComponentScan
. Since these annotations are so frequently used together (especially if you follow the best practices above), Spring Boot provides a convenient @SpringBootApplication
alternative.
The @SpringBootApplication
annotation is equivalent to using @Configuration
, @EnableAutoConfiguration
and @ComponentScan
with their default attributes。
@SpringBootApplication是
@Configuration
, @EnableAutoConfiguration
and @ComponentScan
的组合。
使用时一般写明要扫描的包 @SpringBootApplication(scanBasePackages="com.example")
stereotype annotations 构造型注解
时间: 2024-11-05 22:38:38