Default profile in Spring 3.1

前端 未结 7 1073
执笔经年
执笔经年 2020-11-28 19:56

In my application I have beans annotated with @Profile(\"prod\") and @Profile(\"demo\"). The first one, as you can guess :), is used on beans that

7条回答
  •  执笔经年
    2020-11-28 20:36

    My experience is that using

    @Profile("default")
    

    the bean will only be added to the context if no other profile is identified. If you pass in a different profile, e.g. -Dspring.profiles.active="demo", this profile is ignored.

提交回复
热议问题