In
application.properties
we have the line
spring.profiles.active=LOCALHOST
In
application-DEV.properties
, we have the line
spring.profiles.active=DEV,dbcache,metrics,AWS
. When running the app with
java -jar app.war -Dspring.profiles.active=DEV
the console output says
The following profiles are active: LOCALHOST
, ie the
-Dspring.profiles.active=DEV
argument isn't honored, the app still uses the default LOCALHOST profile.
Just in case some one is having the same issue as me, make sure your main class args is passed into spring. Hope it helps.
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}