Multiple properties file for a single spring profile

前端 未结 4 557
广开言路
广开言路 2020-12-20 06:53

We are using spring boot 2.0.0. We have three environments dev, staging, production. Our current config structure

4条回答
  •  难免孤独
    2020-12-20 07:18

    Have you tried including profiles yet ?

    Example with profile default, you want to load additional properties for redis and db. Within application.properties file, add:

    spring.profiles.include=redis, db

    This will load files application-redis.properties and application-db.properties respectively

提交回复
热议问题