@EnableAutoConfiguration
1. spring文档
解释一:
Enable auto-configuration of the Spring Application Context, attempting to guess and configure beans that you are likely to need. Auto-configuration classes are usually applied based on your classpath and what beans you have defined. For example, If you have tomcat-embedded.jar on your classpath you are likely to want a TomcatEmbeddedServletContainerFactory (unless you have defined your own EmbeddedServletContainerFactory bean).
For example, it will be used when scanning for @Entity classes. It is generally recommended that you place @EnableAutoConfiguration in a root package so that all sub-packages and classes can be searched.
解释二:
@EnableAutoConfiguration annotation auto-configures the beans that are present in the classpath. This simplifies the developers work by guessing the required beans from the classpath and configure it to run the application. This annotation is part of the spring boot project.
根据依赖、类路径、自定义的bean,猜测会用到的bean,从而自动配置。
一般在根包定义中使用。
@ComponentScan("com.example")
@Configuration
@EnableAutoConfiguration
public class BaseProviderApplication {
public static void main(String[] args) {
SpringApplication.run(BaseProviderApplication.class, args);
}
}
@EnableAutoConfiguration的更多相关文章
- SpringBoot的注解:@SpringBootApplication注解 vs @EnableAutoConfiguration+@ComponentScan+@Configuration
spring Boot开发者经常使用@Configuration,@EnableAutoConfiguration,@ComponentScan注解他们的main类, 由于这些注解如此频繁地一块使用( ...
- @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})
@EnableAutoConfiguration 作用:Spring Boot会自动根据你jar包的依赖来自动配置项目. 例如当你项目下面有HSQLDB的依赖时,Spring Boot会创建默认的内存 ...
- EnableAutoConfiguration注解的工作原理(org.springframework.boot.autoconfigure.EnableAutoConfiguration=core.bean.MyConfig)
EnableAutoConfiguration注解的工作原理(org.springframework.boot.autoconfigure.EnableAutoConfiguration=core.b ...
- @EnableAutoConfiguration和@SpringbootApplication注解
一.@EnableAutoConfiguration 这个注释告诉SpringBoot“猜”你将如何想配置Spring,基于你已经添加jar依赖项.如果spring-boot-starter-web已 ...
- springboot EnableAutoConfiguration
http://blog.javachen.com/2016/02/19/spring-boot-auto-configuration.html 自动配置 在启动类上使用@EnableAutoConfi ...
- @EnableAutoConfiguration注解原理
前言 Spring Boot中引入了自动配置,让开发者利用起来更加的简便.快捷.比如内嵌的tomcat端口默认配置是8080,这些都属于Spring Boot自动配置的范畴,当然其自动配置相当多. s ...
- springBoot @EnableAutoConfiguration深入分析
1.新建一个项目中需要提供配置类 2.在META-INF/spring.factorties在文件中配置 org.springframework.boot.autoconfigure.EnableAu ...
- spring-boot启动注解@EnableAutoConfiguration
springboot很多依赖插件是只要有依赖,就会读取相关配置,如果读取不到,就会使用默认的,可能会报错,但是又在项目中不好排除就可以使用 @EnableAutoConfiguration 注解.启动 ...
- SpringBoot自动化配置之三:深入SpringBoot:自定义EnableAutoConfiguration
前言 上面几篇文章介绍了SpringFramework的一些原理,这里开始介绍一下SpringBoot,并通过自定义一些功能来介绍SpringBoot的原理.SpringBoot在SpringFram ...
随机推荐
- jQuery校验validate详解(转)
jQuery校验 官网地址:http://bassistance.de/jquery-plugins/jquery-plugin-validation 一导入js库 <script src=&q ...
- 如何在tpl模版的div块中加ztree
ld-ztree.tpl <div class="ld-ztree-container"> <div class="ld-ztree-header te ...
- OC编程的一些UI细节
1/如果你想用一个半透明的View遮住当前窗口,连并NavigationBar也一并遮住的话,那么你需要 将视图添加到navigationController的View上 [self.navigati ...
- myeclipse中将整块的代码所选中的代码左右移动的快捷键
myeclipse中将整块的代码/所选中的代码左右移动的快捷键选择你要移动的代码,TAB 右移ctrl+TAB左移(我的使用Shift+TAB管用)要是不使用快捷键就是:选中代码,点击右键选中Shif ...
- Objective - C NSArray不可变数组和NSMutableArray可变数组
OC中存储数据最常用 的两个容器就是数组和字典,而作为最常用的,应该了解这所有的特点,及用法. OC中的数组是一个容量,有序的管理了一系列元素,并且存放在数组里的元素,必须是对象类型. 不可变数组,见 ...
- WeedFS问题收集
weed fs FAQ Moving files to a different server Q: Hello,is it possible to move manually the .dat and ...
- 实数---Currency讲解
Currency 实际上是 Int64 的变体,Int64/10000 就是实际的值
- CSS3 04
animate.css库的使用 官网:https://daneden.github.io/animate.css/ 作用:将一切常见的动画直接封装,开发者不需要考虑实现过程,只需要添加对应的类就能实现 ...
- python使用代理ip发送http请求
一.需求背景 网站刷票时,经常会遇到限制一个ip只能投票一次的限制,为此需要使用代理ip 二.脚本如下: 1.Proxy_http.py使用代理ip发送httpr的get和post请求 #coding ...
- iOS图片编辑功能实现
图片加标签:标签可以编辑 https://github.com/shumingli/waterMark 1. 编辑效果;图片可以放到.缩小.旋转 2. 保存相册效果