获取配置文件

    @Autowired
   private Environment env;
    @Test
    public void env(){
        String[] activeProfiles = env.getActiveProfiles();
        for (String activeProfile : activeProfiles) {
            if(!activeProfile.equals("prod")){
                System.out.println();
            }
        }
    }

 

posted @ 2019-11-28 13:28  King-DA  阅读(124)  评论(0编辑  收藏  举报