How to externalize application.properties in Tomcat webserver for Spring?

后端 未结 8 2239
终归单人心
终归单人心 2020-12-10 01:59

SpringApplication will load properties from application.properties files in the following locations and add them to the Spring Environment:



        
8条回答
  •  被撕碎了的回忆
    2020-12-10 02:33

    if anyone is looking for a linux solution, This is working for us:
    edit tomcat startup.sh
    add:

     export spring_config_location=//application.properties
    

    example:

     export spring_config_location=/app/conf/application.properties
    

提交回复
热议问题