spring boot automatically loaded configuration information

Foreword

spring boot integration of most third-party framework, users only need to introduce the corresponding jar package, will automatically complete the basic configuration, this article aims to introduce mechanisms to automatically configure the way

Related Notes

@EnableAutoConfiguration, the comment is automatically loaded springboot inlet configuration information (@SpringBootApplication dependent on the annotation)

The annotation tells all the jar packages under springboot scanning project, find classpath: META-INF / spring.factories file, load the configuration information in the file, the format is as follows:

org.springframework.boot.autoconfigure.EnableAutoConfiguration=core.bean.MyConfig

Wherein core.bean.MyConfig is configured to instantiate the class

@Import, introduced into the general category of container ioc

 

Guess you like

Origin www.cnblogs.com/songrang/p/11526122.html