Spring Boot-Configuring application in an easy way through Spring Boot Profiles
Spring boot set configuration properties default. The application will run on 8080 port.
We can also create a default profile that will work when there is no active profile.
· Set port for application.properties file.
So the application will run on 9000 port.
We can deal with multiple profiles based on the application environment.
A different profile is created for different environments.
· When we creating a profile for multiple environment file names should be in
application-<your environment name>.properties format.
· After creating multiple application files, we can set the different ports for each properties files.
· Set the active profile in the main application file, as below
· So the application will run using application-dev.properties port.
· We can set multiple profiles in the main application.properties file as below.