解决方案一:在pom.xml添加
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
在解决方案一还不能解决的时候,添加了解决方案一的代码后,在配置类上添加
@EnableConfigurationProperties(HelloServiceProperties.class)
//括号内填出现问题的类名