Skip to main content

Spring Boot

Spring boot is sort of a configuration wrapper around the Spring MVC Framework.

Dependency Management

Maven or Gradle are supported. Can be used with Ant, but not reccommended.

Each version of Spring Boot is configured to work with a specific version of Spring Framework. Whenever possible, do not specify versions in POM, allow versions to inherit from parent. Don't override the Spring Framework version!!

Spring Boot Starters

Starters are top level dependencies for popular Java libraries. They will bring in deps for the project and related Spring components (Hibernate, JPA, etc.)

Spring Boot Annotations

  • @SpringBootApplication - main annotation to use. Includes:
    • @Configuration - Delcares class as Spring Configuation
    • @EnableAutoConfiguration - Enables auto configuration
    • @ComponentScan - Scans for components in current package and all child packages

Disabling Specific Auto Config

Autoconfig brings in A LOT of configuration classes in supplied Spring Boot Jars To Exlude: @EnableAutoConfiguration(exlude={DataSourceAutoConfiguration.class}). Pass in the parameter -debug for a report of the Autoconfig