Spring Boot configuration detail

 

Spring Boot can automatically configure common configuration scenarios. If Spring Boot detects that you have the H2 database library in your application’s classpath, it will automatically configure an embedded H2 database. If JdbcTemplate is in the classpath, then it will also configure a JdbcTemplate bean for you. There’s no need for you to worry about configuring those beans. They’ll be configured for you, ready to inject into any of the beans you write.


Spring Boot offers help with project dependency management by way of starter dependencies. Starter dependencies are really just special Maven (and Gradle) dependencies that take advantage of transitive dependency resolution to aggregate commonly used libraries under a handful of feature-defined dependencies.


Spring Boot can take the burden of configuration off your hands, including auto-configuration for the Java Persistence API (JPA), Thymeleaf templates, security, and Spring MVC.


In a typical Spring integration test, you’d annotate the test class with @ContextConfiguration to specify how the test should load the Spring application context.

To take full advantage of Spring Boot magic, the @SpringApplicationConfiguration annotation should be used instead.


application.properties file comes in handy for finegrained configuration of the stuff that Spring Boot automatically configures. But you can also use it to specify properties used by application code.