user10483740
user10483740

Reputation:

How to change profile in application.properties file

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?

Upvotes: 4

Views: 14689

Answers (3)

dogall
dogall

Reputation: 71

The following example shows how to change profile in an application.properties file:

spring.profiles.active= server

Upvotes: 7

nonysingh
nonysingh

Reputation: 91

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.

Upvotes: 4

Steve Nash
Steve Nash

Reputation: 144

you can set spring.profiles.active=server in application.properties

Upvotes: 2

Related Questions