- 出現spring boot Configuration Annotation Proessor not found in classpath的提示是在用了@ConfigurationProperties這個注解時,所以問題出現在ConfigurationProperties注解。
- 根據提示的not found in classpath,查詢此注解的使用關於怎么指定classpath,進而查詢location,spring boot1.5以上版本@ConfigurationProperties取消location注解
解決辦法,引入Maven依賴,在pom.xml文件中加入
<dependency> <groupId> org.springframework.boot </groupId> <artifactId> spring-boot-configuration-processor </artifactId> <optional> true </optional> </dependency>