添加下面的依赖和build插件的config到配置文件中
<!--自定义配置类 配置文件书写提示-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</dependency>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<!--配置打包时,避免加载生成的提示类文件-->
<configuration>
<executable>
<exclude>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</exclude>
</executable>
</configuration>
</plugin>
</plugins>
</build>