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 {
}
@Service
@Profile({"profile1", "profile2"})
public class Printer2 implements Printer {
}
// "不包含profile1或不包含profile2的时候实例化
@Service
@Profile({"!profile1", "!profile2"})
public class Printer2 implements Printer {
}
后一篇:fastjson2使用