For example :
1. I add 3 profiles on pom.xml by default profile prod is active.
-local
-dev
-prod

2. Also add on pom.xml on section <build></build>

3. Add 3 file on Spring boot project src/main/resources, each file is one profile.

4. Add into application.properties

5. if you want change profile create file application.yml and write:

In the image the local is the profile active if you change, change the position the profile. the concepts is similar a pile. if you don't want to create file application.yml then into the application.properties (spring.profiles.active=prod).
that is it.
No comments:
Post a Comment