Expanding on Property Injection with Spring Boot Auto-Configuration

In a previous post, we discovered how auto-configuration in Spring Boot enables bean and configuration creation.

In Spring, managing settings, configuring beans, or handling application constants, properly injecting properties into the environment is crucial. Here we’ll explore different methods of injecting properties in a Spring Boot auto-configuration setup.

Continue reading Expanding on Property Injection with Spring Boot Auto-Configuration

Discover the Different Auto-Configuration Options in Spring Boot

The Spring Boot Auto-Configuration feature simplifies: automatic configuration of beans and components. When Spring Boot detects specific libraries or components in your project (like database dependencies or web modules), it automatically configures those components for you without needing explicit manual configuration.

Key Concepts:

  1. Auto-Configuration Conditions: Spring Boot applies auto-configuration on conditional and profile driven way to be classes available on the classpath or specific properties set in application.properties or application.yml.
  2. EnableAutoConfiguration: This annotation enables auto-configuration, it can be fine-tuned by excluding specific auto-configurations using exclude or excludeName attributes.
  3. @Conditional Annotations: Auto-configuration relies heavily on Spring’s @Conditional annotations, which control whether certain configurations should be applied based on the environment or classpath.
  4. Diagnostics: spring-boot-actuator provides insight into which configurations have been applied, helping with debugging and understanding the auto-configured components.

Documentation here.

Continue reading Discover the Different Auto-Configuration Options in Spring Boot