spring boot Configuration error

Original link: https://blog.csdn.net/w05980598/article/details/79167826

Since spring boot 2.0 is used, use

ConfigurationProperties

Annotation will appear:

Configuration Annotation Proessor not found in classpath

According to the prompt not found in classpath, query the use of this annotation on how to specify the classpath, and then query the location, the spring boot version above 1.5 @ConfigurationProperties cancels the location annotation

Official solution, add dependencies to pom:

<dependency>
   <groupId> org.springframework.boot </groupId>
   <artifactId> spring-boot-configuration-processor </artifactId>
   <optional> true </optional>
</dependency>

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325130110&siteId=291194637