i have application.yml
,application-dev.yml
andapplication-dev.yml
mvn spring-boot:run
If you are using maven, define your profiles as shown below within your pom.xml
local
true
dbUrl
dbuser
dbPassword
dbDriver
dev
dbUrl
dbuser
dbPassword
dbDriver
org.postgresql
postgresql
prod
dbUrl
dbuser
dbPassword
dbDriver
By default, i.e if No profile is selected, the local profile will always be use.
To select a specific profile in Spring Boot 2.x.x, use the below command.
mvn spring-boot:run -Dspring-boot.run.profiles=dev
If you want want to build/compile using properties of a specific profile, use the below command.
mvn clean install -Pdev -DprofileIdEnabled=true