Annotation Interface ImportAutoConfiguration
@Target(TYPE)
@Retention(RUNTIME)
@Documented
@Inherited
@Import(org.springframework.boot.autoconfigure.ImportAutoConfigurationImportSelector.class)
public @interface ImportAutoConfiguration
Import and apply the specified auto-configuration classes. Applies the same ordering
rules as
@EnableAutoConfiguration
but restricts the auto-configuration classes
to the specified set, rather than consulting ImportCandidates
.
Can also be used to exclude()
specific auto-configuration classes such that
they will never be applied.
Generally, @EnableAutoConfiguration
should be used in preference to this
annotation, however, @ImportAutoConfiguration
can be useful in some situations
and especially when writing tests.
- Since:
- 1.3.0
- Author:
- Phillip Webb, Andy Wilkinson
-
Optional Element Summary
-
Element Details
-
value
The auto-configuration classes that should be imported. This is an alias forclasses()
.- Returns:
- the classes to import
- Default:
- {}
-
classes
The auto-configuration classes that should be imported. When empty, the classes are specified using a file inMETA-INF/spring
where the file name is the fully-qualified name of the annotated class, suffixed with '.imports'.- Returns:
- the classes to import
- Default:
- {}
-
exclude
Class<?>[] excludeExclude specific auto-configuration classes such that they will never be applied.- Returns:
- the classes to exclude
- Default:
- {}
-