How to change profile in application.properties file

Tutocxu

New Member
#1
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?
 

Admin

Administrator
Thành viên BQT
#2
In src/main/resources folder, create two new files: application-dev.properties and application-server.properties. These two files correspond to dev profile and server profile! Change profile in application.properties (example to change to server profile):
Mã:
spring.profiles.active=server
 
Top