加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

SpringBoot@Profile用法

(2022-10-22 17:20:00)
分类: JAVA开发
// 启动时指定的profile包含有profile1或profiles的时候实例化
@Service
@Profile({"profile1", "profile2"})
public class Printer2 implements Printer {
}

// "不包含profile1或不包含profile2的时候实例化
@Service
@Profile({"!profile1", "!profile2"})
public class Printer2 implements Printer {
}

0

阅读 收藏 喜欢 打印举报/Report
后一篇:fastjson2使用
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有