Monday, May 22, 2017

Spring Profiles

If your project has 2 profiles

  1. local
  2. prod
you can choose profile when you run using property

spring.profiles.active

create 2 application.properties files one for each profile

  1. application-local.properties
  2. application-prod.properties
when you run the application pass the profile property like below

  1. mvn spring-boot:run -Dspring.profiles.active=local
  2. mvn spring-boot:run -Dspring.profiles.active=prod

No comments:

Post a Comment