I have a Spring Boot 1.4 application that has a YAML based configuration file. The configuration file indicates the default profile:prod
spring:
profiles.active: prod
When I create a war using Maven and deploy it to Tomcat 7, the default profile is not set. Tomcat Magazine:
No active profile set, falling back to default profiles: default
To set the default profile in an application deployed to Tomcat, I can pass the System Tomcat property, for example:
-Dspring.profiles.active=prod
This works, but I would like to use the Spring Boot properties, not the System properties to set the default profile. Is there a reason why the yaml properties file is ignored by default when deploying the application to Tomcat?