I'm using Spring boot to build an app, but don't know ow to change profile in application.properties file. For example, I want to have 2 profiles: "dev" and "server" in my application. How could I do that?
The following example shows how to change profile in an application.properties file:
spring.profiles.active= server
You can specify spring.profiles.active
property in application.property
file which will be the default to be used. Create application-dev.properties
and application-server.properties
for your specific properties.
Application will start with profile as specified in spring.active.profile
property. You can override this by providing command line argument -Dspring.profiles.active
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With