SpringBoot 的@Value 读取不到值下面是重点注意的

2018-09-24  本文已影响0人  在暗处凝视世间喧华繁闹

类上有这三个标签: 

@Component

@ConfigurationProperties(prefix = "file")

@Value("${file.hostname}")

 有这个jar包

 <dependency> 

    <groupId>org.springframework.boot</groupId> 

    <artifactId>spring-boot-configuration-processor</artifactId> 

        <optional>true</optional> 

</dependency>

类的加载得这样

不能new

上一篇 下一篇

猜你喜欢

热点阅读