开发者社区 问答 正文

SpringBoot打包之后获取配置文件内容

最近在学习SpringBoot 自己写了一个名字叫boot的程序。发现如果把代码打包之后,不好获取配置文件的信息了,请问要怎么才能读取下面的etc.xml里面的信息呢 screenshot

展开
收起
a123456678 2016-03-19 09:34:02 4318 分享 版权
1 条回答
写回答
取消 提交回答
  • 
    @Configuration
    @ImportResource({"classpath:etc.xml"})
    @PropertySource(value="classpath:log4j.properties")
    public class SpringBootTestConfiguration {
         
    }
    
    2019-07-17 19:07:16
    赞同 展开评论