Bird
0
0

Given the following application.properties content:

medium📝 state output Q13 of 15
Spring Boot - Application Configuration
Given the following application.properties content:
spring.profiles.active=dev
server.port=9090

What will be the server port when running the app with the dev profile?
A9090 (from properties file)
B8080 (default port)
CRandom port assigned at runtime
DApplication will fail to start
Step-by-Step Solution
Solution:
  1. Step 1: Identify active profile and property

    The active profile is set to dev, and server.port=9090 is defined.
  2. Step 2: Understand profile effect on configuration

    Since server.port is set in the active profile, the app uses port 9090.
  3. Final Answer:

    9090 (from properties file) -> Option A
  4. Quick Check:

    Active profile sets server.port to 9090 [OK]
Quick Trick: Active profile properties override defaults [OK]
Common Mistakes:
  • Assuming default port 8080 always applies
  • Thinking profile disables server port setting
  • Believing app fails without explicit port

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Spring Boot Quizzes