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

后端 未结 8 2220
终归单人心
终归单人心 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:14

    In tomcat/bin create setenv.sh file and in file you need to give below line in file for default properties for all the wars, And save it and restart tomcat.

    export SPRING_PROFILES_ACTIVE=dev
    

提交回复
热议问题