i have application.yml,application-dev.ymlandapplication-dev.yml
mvn spring-boot:run
Create specific .yml files in the resources directory for each and every environment(Eg: dev,qa,stg etc.) that you need to run the application. image of .yml files in resources directory
If you are using spring-boot-maven-plugin 2.0.5.RELEASE in your pom.xml file you can add the profiles within the dependency tag as follows. image of pom.xml spring-boot-maven-plugin (you can configure multiple profiles using multiple profile tags)
Then you can use the following commands to build and run the project.
1) mvn clean install
2) mvn spring-boot:run -Dspring-boot.run.default==qa
Then you will see that the default profile is set as qa while running the project. displaying the default profile when running the application