@Component
@ConfigurationProperties(prefix = "test")
public class TestProperties {
}
# 问题描述:
# 加上注解 @ConfigurationProperties(prefix = "test")之后,idea抛错:
# Spring Boot Configuration Annotation Proessor not found in classpath
# 解决方式:
# 在pom.xml中加入spring-boot-configuration-processor依赖即可
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
网友评论