Share:- Whatsapp Facebook Facebook

------------------------------------- Welcome to Developerhelpway Q&A, where you can ask questions and receive answers from other members of the community.

How can you use profiles to configure environment specific configuration with Spring Boot?

0 votes
13 views
How can you use profiles to configure environment specific configuration with Spring Boot?
asked Feb 8 in Spring Boot by Anji

1 Answer

0 votes
In Spring boot Profiles help to have different application configuration for different environments.

As we know that, Enterprise application development have multiple environments or phases:-
   * Dev
   * QA
   * Stage
   * Production

There are  following multiple ways to activate the profiles in spring boot:-
   * Using -Dspring.profiles.active=prod in VM Arguments
   * Use spring.profiles.active=prod in application.properties

When you map with prod then your prod properties file configuration pickup. Once you have profile specific configuration, you would need to set the active profile in an environment.
answered Feb 12 by ranju_12 (3,520 points)
...