Annotation Type 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
.- Since:
- 1.2.0
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description 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.
Element Detail
exclude
@AliasFor(annotation=EnableAutoConfiguration.class) Class<?>[] exclude
Exclude specific auto-configuration classes such that they will never be applied.- Returns:
- the classes to exclude
- Default:
- {}
excludeName
@AliasFor(annotation=EnableAutoConfiguration.class) String[] excludeName
Exclude specific auto-configuration class names such that they will never be applied.- Returns:
- the class names to exclude
- Since:
- 1.3.0
- Default:
- {}
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.- Returns:
- base packages to scan
- Since:
- 1.3.0
- Default:
- {}
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.
- Returns:
- base packages to scan
- Since:
- 1.3.0
- Default:
- {}