Default profile in Spring 3.1

前端 未结 7 1072
执笔经年
执笔经年 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:30

    Define your production environment as default profile in your web.xml

    
       spring.profiles.default
       prod
    
    

    and if you want to use a different profile pass it as system property

    mvn -Dspring.profiles.active="demo" jetty:run
    

提交回复
热议问题