In this tutorial I explained how spring boot auto-configuration works. Its actually picked up dependencies from the classpath and auto-configuration mechanism will ensure to create those necessary beans.
This is one of the most powerful feature of the Spring Boot.
Also explained how to generate Auto-Configuration Report. For this we need to set the debug=true in the application.properties file. After that if we run application then in the console we can get the Report.
From that report we can identify how spring load all the dependencies.
@Conditional Annotation is the base and most annotations used by the Spring Boot auto-configuration.
For using @Conditioanl annotation we can use something like below
@Bean
@Conditional(WindowsOsCondition.class)
public WindowsOs windosOs() {
return new WindowsOs();
}
#javatechsolutions #springboot #java
Ещё видео!