码迷,mamicode.com
首页 > 编程语言 > 详细

SpringBoot bootstrap 配置文件没有生效

时间:2018-03-15 11:07:38      阅读:1083      评论:0      收藏:0      [点我收藏+]

标签:log   配置   pen   das   trap   pom   支持   生效   text   

今天单独使用SpringBoot,发现其中的bootstrap.properties文件无法生效,改成yaml格式也无济于事。

 

最后调查发现原来是因为SpringBoot本身并不支持,需要和Spring Cloud 的组件结合——只有加上Spring Cloud Context依赖才能生效。

 

即在pom中引入:

        <!--需要引入该jar才能使bootstrap配置文件生效-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-context</artifactId>
        </dependency>

 

问题解决。

SpringBoot bootstrap 配置文件没有生效

标签:log   配置   pen   das   trap   pom   支持   生效   text   

原文地址:https://www.cnblogs.com/flying607/p/8571556.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!