使用@ConfigurationProperties(prefix = " ")批量注入时提示spring boot configuration annotation processor not configured
解决方案
maven工程在pom.xml文件中引入坐标
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-configuration-processor --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId> <optional>true</optional> </dependency>
Gradle工程在build.gradle中引入
dependencies { annotationProcessor "org.springframework.boot:spring-boot-configuration-processor" }