注释类型 SpringBootApplication
@Target(TYPE) @Retention(RUNTIME) @Documented @Inherited @SpringBootConfiguration @EnableAutoConfiguration @ComponentScan(excludeFilters={@Filter(type=CUSTOM,classes=org.springframework.boot.context.TypeExcludeFilter.class),}) public @interface SpringBootApplication
Indicates aconfiguration
class that declares one or more@Bean
methods and also triggersauto-configuration
andcomponent scanning
. This is a convenience annotation that is equivalent to declaring@Configuration
,@EnableAutoConfiguration
and@ComponentScan
.- 从以下版本开始:
- 1.2.0
可选元素概要
可选元素 修饰符和类型 可选元素 说明 Class<?>[]
exclude
Exclude specific auto-configuration classes such that they will never be applied.String[]
excludeName
Exclude specific auto-configuration class names such that they will never be applied.Class<?>[]
scanBasePackageClasses
Type-safe alternative toscanBasePackages()
for specifying the packages to scan for annotated components.String[]
scanBasePackages
Base packages to scan for annotated components.
元素详细资料
exclude
@AliasFor(annotation=EnableAutoConfiguration.class, attribute="exclude") Class<?>[] exclude
Exclude specific auto-configuration classes such that they will never be applied.- 返回:
- the classes to exclude
- 默认值:
- {}
excludeName
@AliasFor(annotation=EnableAutoConfiguration.class, attribute="excludeName") String[] excludeName
Exclude specific auto-configuration class names such that they will never be applied.- 返回:
- the class names to exclude
- 从以下版本开始:
- 1.3.0
- 默认值:
- {}
scanBasePackages
@AliasFor(annotation=org.springframework.context.annotation.ComponentScan.class, attribute="basePackages") String[] scanBasePackages
Base packages to scan for annotated components. UsescanBasePackageClasses()
for a type-safe alternative to String-based package names.- 返回:
- base packages to scan
- 从以下版本开始:
- 1.3.0
- 默认值:
- {}
scanBasePackageClasses
@AliasFor(annotation=org.springframework.context.annotation.ComponentScan.class, attribute="basePackageClasses") Class<?>[] scanBasePackageClasses
Type-safe alternative toscanBasePackages()
for specifying the packages to scan for annotated components. The package of each class specified will be scanned.Consider creating a special no-op marker class or interface in each package that serves no purpose other than being referenced by this attribute.
- 返回:
- base packages to scan
- 从以下版本开始:
- 1.3.0
- 默认值:
- {}