How can a custom auto-configuration be created in Spring Boot?

  • By defining a class annotated with @SpringBootApplication.
  • By using the @EnableAutoConfiguration annotation.
  • By creating a class with @Configuration and @ConditionalOnClass annotations.
  • By specifying properties in the application.properties file.
In Spring Boot, you can create custom auto-configurations by defining a class with the @Configuration annotation and using the @ConditionalOnClass annotation to conditionally enable the configuration based on the presence of specific classes. This allows you to control when your custom auto-configuration should be applied. The other options do not directly relate to creating custom auto-configurations in Spring Boot.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *