Submitted by heartin on Sun, 10/23/2016 - 01:16
EnableAutoConfiguration annotation attempt to guess and configure beans that you are likely to need.
Auto-configuration classes are usually applied based on the presence or absence of, files or libraries in your classpath, beans you have defined, and properties.
Auto-configuration is always applied after user-defined beans have been registered.
Submitted by heartin on Sat, 10/22/2016 - 23:47
If you need to run some specific code once the SpringApplication has started, you can implement the ApplicationRunner or CommandLineRunner interfaces. Both interfaces work in the same way and offer a single run method which will be called just before SpringApplication.run(…) completes.
The CommandLineRunner interfaces provides access to application arguments as a simple string array, whereas the ApplicationRunner uses the ApplicationArguments interface.
Submitted by heartin on Sat, 10/22/2016 - 23:45
Spring Boot has no mandatory logging dependency, except for the Commons Logging API, of which there are many implementations to choose from.
Spring Boot attempts to configure logging based on the content of the classpath if you use spring-boot-starter-logging. Other starters such as spring-boot-starter-web depends transitively on the logging starter, and hence it is automatically added if they are being used.
Submitted by heartin on Sat, 10/22/2016 - 23:43
Bill of Materials
Spring boot calls its collection of dependencies as BOM or bill of materials.
The Spring Boot starter parent is responsible for most of the default configurations, plugins etc. which aides in the BOM. When adding dependencies, Spring boot tries to add matching dependency versions which will work together well. Your starter dependencies such as spring-boot-starter-web will not have to specify any versions.
Submitted by heartin on Sat, 09/10/2016 - 23:47
A Spring Boot application uses the @SpringBootApplication annotation over the main executable class. The SpringApplication.run method call accepts two parameters — the configuration class annotated with @SpringBootApplication annotation and any application arguments.
We will use a simple bean class based on our previous examples.