Spring Boot 运行原理 - 查看Spring Boot自动配置项
2017-04-26 17:10
1066 查看
1 查看Spring Boot自动配置项
Spring Boot 自动配置源代码在spring-boot-autoconfigure-1.5.3.RELEASE.jar内,如图:如果想知道Spring Boot做了那些自动配置可以在这里看源码。
可以通过下面三种方式查看当前项目中已启用和未启动的自动配置报告:
运行jar时添加--debug参数:
java -jar xx.jar --debug
在application.properties文件中加属性:
debug=true
在STS中进行设置,如图:
此时启动会在控制台输出,已启用的自动配置:
========================= AUTO-CONFIGURATION REPORT ========================= Positive matches: ----------------- DefaultValidatorConfiguration#defaultValidator matched: - @ConditionalOnMissingBean (types: javax.validation.Validator,org.springframework.validation.Validator; SearchStrategy: all) did not find any beans (OnBeanCondition) DispatcherServletAutoConfiguration matched: - @ConditionalOnClass found required class 'org.springframework.web.servlet.DispatcherServlet'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) - @ConditionalOnWebApplication (required) found StandardServletEnvironment (OnWebApplicationCondition) DispatcherServletAutoConfiguration.DispatcherServletConfiguration matched: - @ConditionalOnClass found required class 'javax.servlet.ServletRegistration'; @ConditionalOnMissingClass did not find unwanted class (OnClassCondition) - Default DispatcherServlet did not find dispatcher servlet beans (DispatcherServletAutoConfiguration.DefaultDispatcherServletCondition) ...
未启用的自动配置:
Negative matches: ----------------- ActiveMQAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'javax.jms.ConnectionFactory', 'org.apache.activemq.ActiveMQConnectionFactory' (OnClassCondition) AopAutoConfiguration: Did not match: - @ConditionalOnClass did not find required classes 'org.aspectj.lang.annotation.Aspect', 'org.aspectj.lang.reflect.Advice' (OnClassCondition) ...
以排除的自动配置
Exclusions: ----------- None
无条件类:
Unconditional classes: ---------------------- org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration org.springframework.boot.autoconfigure.web.WebClientAutoConfiguration org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration
相关文章推荐
- 【springboot】基于springboot运行原理实现springboot的自动配置
- SpringBoot学习笔记(3) Spring Boot 运行原理,自动配置
- SpringBoot学习笔记(3) Spring Boot 运行原理,自动配置
- Spring Boot 运行原理之自动配置
- SpringBoot自动配置原理
- Spring Boot核心原理-自动配置
- Spring Boot自动配置原理、实战
- Spring Boot核心原理-自动配置
- [Spring Boot] 4. Spring Boot实现自动配置的原理
- 全面解析SpringBoot自动配置的实现原理
- 3Spring Boot 运行原理,自动配置
- 【SpringBoot】的核心配置和运行原理
- Spring Boot核心原理-自动配置
- Spring Boot自动配置原理(转)
- Spring Boot之自动配置的原理
- 【Spring Boot 系列 自动配置原理分析】
- 《Spring Boot 实战:从0到1》第3章 Spring Boot自动配置原理
- Spring Boot核心原理-自动配置
- SpringBoot学习笔记(三) SpringBoot 自动配置原理
- springboot自动配置的核心原理