Environment Specific application.properties file in Spring Boot application -
in spring boot application, want create environment specific properties file. packaging type of application in war , executing in embedded tomcat. use sts , execute main sts itself.
- can have environment specific properties file application-${env-value}.properties?
in above case, env-value have values local/devl/test/prod
where set env-value file? local, can set jvm argument through sts
who reads application.properties in spring boot application.
how load environment specific properties file? ex - if set database uid,pwd, schema etc in environment specific property file, in case datasource able understand properties in it?
can use application.properties , application-local.properties file @ same time?
spring boot has support profile based properties.
simply add application-[profile].properties
file , specify profiles use using spring.profiles.active
property.
-dspring.profiles.active=local
this load application.properties
, application-local.properties
latter overriding properties first.
Comments
Post a Comment