Recall & Review
beginner
What is profile-based configuration in Spring Boot?
It is a way to define different settings for different environments (like development, testing, production) so the app behaves correctly in each.
Click to reveal answer
beginner
How do you activate a Spring Boot profile?
You can activate a profile by setting the property
spring.profiles.active in application.properties or by passing --spring.profiles.active=profileName as a command line argument.Click to reveal answer
beginner
What file naming convention does Spring Boot use for profile-specific properties?
Spring Boot uses
application-{profile}.properties or application-{profile}.yml where {profile} is the profile name, like application-dev.properties.Click to reveal answer
intermediate
Can multiple profiles be active at the same time in Spring Boot?
Yes, you can activate multiple profiles by separating them with commas, like
spring.profiles.active=dev,debug. Settings from all active profiles are combined.Click to reveal answer
beginner
Why is profile-based configuration useful in real projects?
It helps keep environment-specific settings separate, so you don’t mix development settings with production ones. This reduces errors and makes deployment safer.
Click to reveal answer
Which file would Spring Boot load if the active profile is 'test'?
✗ Incorrect
Spring Boot loads the profile-specific file named with the active profile, like application-test.properties.
How do you specify the active profile when running a Spring Boot app from the command line?
✗ Incorrect
The correct syntax is --spring.profiles.active=profileName to activate a profile.
If no profile is active, which configuration file does Spring Boot use?
✗ Incorrect
Spring Boot uses application.properties as the default configuration file when no profile is active.
Can you combine settings from multiple active profiles?
✗ Incorrect
Spring Boot merges settings from all active profiles, allowing combined configuration.
What is the main benefit of using profile-based configuration?
✗ Incorrect
Profile-based configuration helps keep environment-specific settings separate, reducing errors.
Explain how to set up and use profile-based configuration in a Spring Boot project.
Think about how you tell Spring Boot which environment to use and where you put the settings.
You got /4 concepts.
Describe why profile-based configuration is important for deploying applications safely.
Consider what could go wrong if all settings were mixed together.
You got /4 concepts.