Recall & Review
beginner
What is custom auto-configuration in Spring Boot?
Custom auto-configuration lets you create your own automatic setup for Spring Boot apps. It helps add features or settings without writing extra code each time.
Click to reveal answer
beginner
Which annotation marks a class as an auto-configuration class in Spring Boot?The <code>@Configuration</code> annotation marks the class as a configuration, and <code>@ConditionalOnClass</code> or other <code>@Conditional</code> annotations control when it applies.Click to reveal answer
intermediate
How does Spring Boot know to load your custom auto-configuration?
You list your auto-configuration class in a file named <code>META-INF/spring.factories</code> under the key <code>org.springframework.boot.autoconfigure.EnableAutoConfiguration</code>.Click to reveal answer
intermediate
What is the role of
@ConditionalOnClass in custom auto-configuration?It makes sure your auto-configuration runs only if a certain class is on the classpath, avoiding errors if dependencies are missing.Click to reveal answer
beginner
Why use custom auto-configuration instead of manual configuration?
It saves time by automating setup, reduces repeated code, and makes your app easier to maintain and extend.
Click to reveal answer
What file must you create to register your custom auto-configuration in Spring Boot?
✗ Incorrect
Custom auto-configurations are registered in META-INF/spring.factories under the EnableAutoConfiguration key.
Which annotation helps your auto-configuration activate only when a specific class is present?
✗ Incorrect
@ConditionalOnClass checks if a class is on the classpath before applying the configuration.
What is the main benefit of custom auto-configuration?
✗ Incorrect
Custom auto-configuration automates feature setup, reducing manual work.
Which annotation is essential to mark a class as a configuration source in Spring Boot?
✗ Incorrect
@Configuration marks a class as a source of bean definitions.
Where do you place your custom auto-configuration class in a Spring Boot project?
✗ Incorrect
Auto-configuration classes are normal Java classes annotated with @Configuration placed in the main source folder.
Explain how to create and register a custom auto-configuration in Spring Boot.
Think about the steps from writing the class to telling Spring Boot about it.
You got /3 concepts.
Describe why conditional annotations are important in custom auto-configuration.
Consider what happens if a class your config needs is not present.
You got /3 concepts.