Spring datasource configuration for localhost, development, and production

前端 未结 6 914
暖寄归人
暖寄归人 2021-02-02 00:53

I\'m trying to figure out how my Spring app can determine where it is deployed and load the appropriate datasource. We have 3 environments...my local, the development server, a

6条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-02 01:26

    Pass a system property to the property placeholder, but include all three files in the WAR:

    
        
            
               classpath:/resources/properties/${myenv}.datasource.properties
            
        
    
    

提交回复
热议问题