Bird
0
0

You want to run a Spring Boot application with a custom profile named 'dev'. Which command line argument should you use?

hard📝 Application Q8 of 15
Spring Boot - Fundamentals
You want to run a Spring Boot application with a custom profile named 'dev'. Which command line argument should you use?
A--spring.profiles.active=dev
B--profile=dev
C-Dspring.profile=dev
D--spring.active.profile=dev
Step-by-Step Solution
Solution:
  1. Step 1: Recall Spring Boot profile activation syntax

    The correct property to activate a profile is spring.profiles.active.
  2. Step 2: Match correct command line argument

    Use --spring.profiles.active=dev to activate the 'dev' profile at runtime.
  3. Final Answer:

    --spring.profiles.active=dev -> Option A
  4. Quick Check:

    Activate profile with --spring.profiles.active [OK]
Quick Trick: Use --spring.profiles.active=profileName to set profile [OK]
Common Mistakes:
  • Using wrong property names
  • Confusing system properties with Spring properties
  • Omitting 'profiles' keyword

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes