application.yml and profiles
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
configure the app with YAML and switch profiles.
Planned topics
application.ymlholds settings in a readable tree;.propertiessays the same in flat form.- A profile is a named set of settings, such as
devorprod. - Profile files:
application-dev.yml,application-prod.yml; they add to or override the base file. - Activate with
spring.profiles.active=devor the environment variableSPRING_PROFILES_ACTIVE.
Draft outline details
Demonstration
# application.yml
shop:
currency: EUR
---
# application-dev.yml
shop:
currency: USDCheck your understanding
How do you choose the prod profile without editing files?
Show answer
Set SPRING_PROFILES_ACTIVE=prod.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.