问题
在开发中我们经常会写xxxxProperties,在配置文件中配置参数和Properties做映射。经常碰到有Spring Boot Confiquration Annotation Processor not configured
这个提示:
在application.yml中我们也会遇到springBoot官方的配置带自动提示,而我们自己写的不带。
解决
加入依赖:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
这个配置只是为了优化开发阶段,对实际生产没有任何意义,所以在打包时候可以不把该依赖打包进程序:
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>