Annotation Interface EnableAutoConfiguration
tomcat-embedded.jar on your classpath you are likely to want a
cn.taketoday.framework.web.embedded.tomcat.TomcatServletWebServerFactory
(unless you have defined your own
cn.taketoday.framework.web.servlet.server.ServletWebServerFactory bean).
When using @Application, the auto-configuration
of the context is automatically enabled and adding this annotation has therefore no
additional effect.
Auto-configuration tries to be as intelligent as possible and will back-away as you
define more of your own configuration. You can always manually exclude() any
configuration that you never want to apply (use excludeName() if you don't
have access to them). You can also exclude them via the
context.autoconfigure.exclude property. Auto-configuration is always applied
after user-defined beans have been registered.
The package of the class that is annotated with @EnableAutoConfiguration,
usually via @SpringBootApplication, has specific significance and is often used
as a 'default'. For example, it will be used when scanning for @Entity classes.
It is generally recommended that you place @EnableAutoConfiguration (if you're
not using @SpringBootApplication) in a root package so that all sub-packages
and classes can be searched.
Auto-configuration classes are regular Framework @Configuration
beans. They are located using ImportCandidates and the TodayStrategies
mechanism (keyed against this class). Generally auto-configuration beans are
@Conditional beans (most often using
@ConditionalOnClass and
@ConditionalOnMissingBean annotations).
- 从以下版本开始:
- 4.0 2022/2/1 02:37
- 作者:
- Phillip Webb, Stephane Nicoll, Harry Yang
- 另请参阅:
-
ConditionalOnBeanConditionalOnMissingBeanConditionalOnClassAutoConfigureAftercn.taketoday.framework.Application
-
可选元素概要
可选元素 -
字段概要
字段修饰符和类型字段说明static final StringEnvironment property that can be used to override when autoconfiguration is enabled.
-
字段详细资料
-
ENABLED_OVERRIDE_PROPERTY
Environment property that can be used to override when autoconfiguration is enabled.- 另请参阅:
-
-
元素详细资料
-
exclude
Class<?>[] excludeExclude specific auto-configuration classes such that they will never be applied.- 返回:
- the classes to exclude
- 默认值:
- {}
-
excludeName
String[] excludeNameExclude specific auto-configuration class names such that they will never be applied.- 返回:
- the class names to exclude
- 默认值:
- {}
-