方法一:使用@ImportResource

 

 

方法二:在test中

@ContextConfiguration(locations = "classpath:spring-profile.xml")

 

 

方法三:使用@PropertySource

 

 

方法四:方法四:使用SpringApplication.setSources()

 

posted on 2019-09-03 14:53  刘达人186  阅读(2016)  评论(0编辑  收藏  举报