On the bottom profile of spring boot application.yam (application.property) mounting principle

* In the spring boot has a basic configuration file application.yam (application.property) for the default setting spring boot to make some changes.

* There are many other packages or integrated frame spring boot, as the package, the redis operation log and the like.

* When spring boot program starts, that is the following categories:

@SpringBootApplication 
public class Springboot1Application {

public static void main (String [] args) {
SpringApplication.run (Springboot1Application.class, args);
}
}
In the above there is a @SpringBootApplication annotation, the annotation in the source code above and a @EnableAutoConfiguration annotation, this annotation says that enabled custom assembly.
With @EnableAutoConfiguration the annotation, it will find the value of EnableAutoConfiguration META-INF / spring.factoris configured when the program starts, in these
values is integrated into the other comprising a frame or packet of spring boot automatic assembly class. These automatic assembly classes are also defined in the context of the spring to be injected into the container class, and the value of the property of these classes
are the initial setting takes a value or application.yam (application.property) profile, as well as taking application. yam (application.property) profile which prefix
the value set later, or takes a value taken at the initial setting value profile certain circumstances in some cases. Then injected into spring boot completion object context

value * last start in spring boot or some place need to use implanted objects, the value of the object will be when we set in the configuration file

 

Guess you like

Origin www.cnblogs.com/maycpou/p/11621836.html