Spring Boot Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 8: Line 8:


=Autoconfiguration=
=Autoconfiguration=
With autoconfiguration, Spring Boot can make reasonable guesses of what components need to be configured and wired together based on the classpath content, environment variables and other factors.


Also see Spring Framework's [[Spring_Dependency_Injection_and_Inversion_of_Control_Container_Concepts#Autoconfiguration|Spring Framework autoconfiguration]].
Also see Spring Framework's [[Spring_Dependency_Injection_and_Inversion_of_Control_Container_Concepts#Autoconfiguration|Spring Framework autoconfiguration]].

Revision as of 05:30, 10 October 2018

Internal

Spring Project Structure

Spring Initializr Project Structure

Autoconfiguration

With autoconfiguration, Spring Boot can make reasonable guesses of what components need to be configured and wired together based on the classpath content, environment variables and other factors.

Also see Spring Framework's Spring Framework autoconfiguration.

@SpringBootApplication

@EnableAutoConfiguration

Developer Tools (DevTools)

Additional set of tools that come as part of Spring Boot, and which can make, according to the documentation, "development experience a little more pleasant". The artifacts are identified as org.springframework.boot:spring-boot-devtools. They include the following development-time features:

  • ?
  • ?
  • ?

Development tools are disabled when running as a fully packaged application (such as with java -jar). They should be declared optional in Maven or "compileOnly" in Gradle.

Configuration Processor

TO process: https://docs.spring.io/spring-boot/docs/2.0.5.RELEASE/reference/htmlsingle/#configuration-metadata-annotation-processor.

Caching

Spring Boot automatically configures a suitable cache manager to serve as provider for the relevant cache.

TODO: https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-caching.html. Also see Spring Framework Cache Abstraction.

Spring Boot Starter Dependency

What is a SpringBoot starter?


'spring-boot-starter' is included in all other starters.

How do I see what's in a starter?

IntelliJ Support

IntelliJ IDEA Plugin for Spring Boot

Testing

Process: https://spring.io/blog/2016/04/15/testing-improvements-in-spring-boot-1-4

@SpringBootTest

@WebMvcTest

Testing Logging Configuration

By default, test logging is executed by Logback.

Actuator

Spring Boot Actuator

Spring Boot CLI

Spring Boot CLI