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的更多相关文章

  1. SpringBoot的注解:@SpringBootApplication注解 vs @EnableAutoConfiguration+@ComponentScan+@Configuration

    spring Boot开发者经常使用@Configuration,@EnableAutoConfiguration,@ComponentScan注解他们的main类, 由于这些注解如此频繁地一块使用( ...

  2. @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})

    @EnableAutoConfiguration 作用:Spring Boot会自动根据你jar包的依赖来自动配置项目. 例如当你项目下面有HSQLDB的依赖时,Spring Boot会创建默认的内存 ...

  3. EnableAutoConfiguration注解的工作原理(org.springframework.boot.autoconfigure.EnableAutoConfiguration=core.bean.MyConfig)

    EnableAutoConfiguration注解的工作原理(org.springframework.boot.autoconfigure.EnableAutoConfiguration=core.b ...

  4. @EnableAutoConfiguration和@SpringbootApplication注解

    一.@EnableAutoConfiguration 这个注释告诉SpringBoot“猜”你将如何想配置Spring,基于你已经添加jar依赖项.如果spring-boot-starter-web已 ...

  5. springboot EnableAutoConfiguration

    http://blog.javachen.com/2016/02/19/spring-boot-auto-configuration.html 自动配置 在启动类上使用@EnableAutoConfi ...

  6. @EnableAutoConfiguration注解原理

    前言 Spring Boot中引入了自动配置,让开发者利用起来更加的简便.快捷.比如内嵌的tomcat端口默认配置是8080,这些都属于Spring Boot自动配置的范畴,当然其自动配置相当多. s ...

  7. springBoot @EnableAutoConfiguration深入分析

    1.新建一个项目中需要提供配置类 2.在META-INF/spring.factorties在文件中配置 org.springframework.boot.autoconfigure.EnableAu ...

  8. spring-boot启动注解@EnableAutoConfiguration

    springboot很多依赖插件是只要有依赖,就会读取相关配置,如果读取不到,就会使用默认的,可能会报错,但是又在项目中不好排除就可以使用 @EnableAutoConfiguration 注解.启动 ...

  9. SpringBoot自动化配置之三:深入SpringBoot:自定义EnableAutoConfiguration

    前言 上面几篇文章介绍了SpringFramework的一些原理,这里开始介绍一下SpringBoot,并通过自定义一些功能来介绍SpringBoot的原理.SpringBoot在SpringFram ...

随机推荐

  1. Druid安装-单机

    单机版安装 下载安装包http://static.druid.io/artifacts/releases/druid-0.9.1.1-bin.tar.gz 安装  解压缩 安装zookeeper cu ...

  2. peer not authenticated error

    问题背景 系统:OS X El Capitan,10.11.2 IDE:Android Studio 2.0 Preview Java:1.8.0_65 Gradle:2.3 clone了代码后,在i ...

  3. Android自动化学习笔记之MonkeyRunner:用Eclipse执行MonkeyRunner脚本

    Info: 初步学习,难免会有疏漏,以后我会不断修改补全,直到完美.转载请注明出处,谢谢. 2014-10-11: 初版 2014-10-16: 完善 ------------------------ ...

  4. (Hibernate进阶)Hibernate映射——一对多关联映射(七)

    一对多关联映射 映射原理 一对多关联映射和多对一关联映射的映射原理是一致的,都是在多的一端加入一个外键,指向一的一端.关联关系都是由多端维护,只是在写映射时发生了变化. 多对一和一对多的区别 多对一和 ...

  5. CentOS7.2部署OpenStack(一)—环境准备

    1.系统环境 # uname -r 3.10.0-327.el7.x86_64 # cat /etc/redhat-release CentOS Linux release 7.2.1511 (Cor ...

  6. nginx相关的一些记录

    http redirect to https: if ($http_cf_visitor ~ '"scheme":"http"'){ rewrite ^/(.* ...

  7. 解决UITableView上计时器(Timer)的滑动问题

    要想计时器(Timer)不因UITableView的滑动而停止工作,就得探讨一下RunLoop了. RunLoop本质和它的意思一样是运行着的循环,更确切的说是线程中的循环.它用来接受循环中的事件和安 ...

  8. JAVA EE中session的理解

    转自[互动百科]http://www.baike.com/wiki/Session   Session Session:在计算机中,尤其是在网络应用中,称为“会话”.Session直接翻译成中文比较困 ...

  9. java自编时间工具类

    package timeTools; import java.text.ParseException; import java.text.SimpleDateFormat; import java.u ...

  10. ASP.NET Misconfiguration: Request Validation Disabled

    Abstract: Use the ASP.NET validation framework to prevent vulnerabilities that result from unchecked ...