Override Properties file in Spring WebApp at Runtime

前端 未结 3 1494
耶瑟儿~
耶瑟儿~ 2020-12-22 04:57

I am loading properties file in my Spring WebApplication using PropertyPlaceholderConfigurer as below:



        
3条回答
  •  暖寄归人
    2020-12-22 05:26

    What I did to resolve the problem is, replaced the location attribute as ${ext.properties.dir:classpath:}/override.properties, as follows:

    
    

    And supplied ext.properties.dir value from application-server/jvm as:

    -Dext.properties.dir=file:/Users/ArpitAggarwal/properties/
    

    Reference: 6-tips-for-managing-property-files-with-spring.

提交回复
热议问题