I wanted to set application.properties file outside of the war file while deploying on the tomcat and here is my observation
1. When i was setting jvm property as
spring.config.location=C:/Users/user_name/Documents/Softwares/apache-tomcat-8.0.53-windows-x64/apache-tomcat-8.0.53/webapps/config/
in the catalina.properties file.. it was not understood by the tomcat and threw runtime error in reading one location property that is defined in the application.properties file (basically it couldn't resolve the location)
but when i set the profile as below
spring.profiles.active=dev
and the profile was picked up correctly.
so, what is the big difference in setting these two properties. also i believe these are these are jvm properties that spring boot take as environment properties in runtime. am i correct here?
2. when i set the same spring.config.location in a new file named setenv.sh as below
set JAVA_OPTS=-Dspring.config.location=C:/Users/user_name/Documents/Softwares/apache-tomcat-8.0.53-windows-x64/apache-tomcat-8.0.53/webapps/config/
meanind setting the property as the java system variable, this time spring boot application picked it up correctly.
so, what is the big difference in setting a property through catalina.properties file than to setenv.bat file.
Kindly enlighten.