How can you exclude certain auto-configuration classes in Spring Boot to prevent them from being applied?
- By using the @ExcludeAutoConfiguration annotation.
- By removing the auto-configuration JAR files from the classpath.
- By specifying exclusions in the application.properties file.
- By annotating a class with @EnableAutoConfiguration(exclude = ...)
In Spring Boot, you can exclude certain auto-configuration classes by specifying their names in the spring.autoconfigure.exclude property in the application.properties file. This prevents those specific auto-configurations from being applied. The other options either do not exist in Spring Boot or do not serve the same purpose of excluding auto-configurations.
Loading...
Related Quiz
- What is the primary purpose of using TestContainers in Spring Boot?
- The JVM option ________ can be optimized to allocate more memory to a Spring Boot application.
- What is the role of the Init method in the Bean Lifecycle in Spring?
- How would you implement a custom caching strategy in Spring Boot if the default ones do not meet your requirements?
- How can you create a shared bean that is not a singleton in Spring Boot?