Challenge - 5 Problems
Spring Boot Config Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate1:30remaining
Alternative to application.yml for configuration in Spring Boot
Which file can be used as a direct alternative to
application.yml for defining configuration properties in Spring Boot?Attempts:
2 left
💡 Hint
Think about the default property file format supported by Spring Boot besides YAML.
✗ Incorrect
Spring Boot supports application.properties as the standard alternative to application.yml for configuration. Both serve the same purpose but use different formats.
❓ component_behavior
intermediate1:30remaining
Behavior difference between application.yml and application.properties
What is a key difference in how Spring Boot processes
application.yml compared to application.properties?Attempts:
2 left
💡 Hint
Consider how nested configuration is represented in each format.
✗ Incorrect
YAML allows nested structures using indentation, making it easier to represent complex configurations. Properties files use dot notation keys to simulate nesting.
📝 Syntax
advanced2:00remaining
Correct syntax for list in application.properties
How do you define a list of values for a property named
app.servers in application.properties?Attempts:
2 left
💡 Hint
Think about how lists are represented in properties files.
✗ Incorrect
In application.properties, lists are represented as comma-separated values in a single line.
🔧 Debug
advanced2:00remaining
Why does Spring Boot ignore my application.properties file?
You have both
application.yml and application.properties in your Spring Boot project. You update application.properties but changes are not reflected at runtime. What is the most likely reason?Attempts:
2 left
💡 Hint
Consider the order in which Spring Boot loads configuration files.
✗ Incorrect
Spring Boot loads application.yml before application.properties, but properties in application.yml override those in application.properties if both exist.
❓ state_output
expert2:30remaining
Resulting property value with multiple config files
Given these files in a Spring Boot project:
server:
port: 8080
server.port=9090
What port will the embedded server run on?
application.yml:server:
port: 8080
application.properties:server.port=9090
What port will the embedded server run on?
Attempts:
2 left
💡 Hint
Remember the precedence rules of Spring Boot configuration files.
✗ Incorrect
Spring Boot gives higher priority to application.yml over application.properties. So the port 8080 from YAML is used.