解决spring boot1.5以上版本@ConfigurationProperties提示“Spring Boot Configuration Annotation Processor not.."
2018-08-10 17:35
716 查看
Springboot1.5以上版本,在使用 @ConfigurationProperties注解的时候会提示“Spring Boot Configuration Annotation Processor not found in classpath”,
这是因为新版本已经取消了对location的支持,替代方案是使用
@Configuration和@PropertySource进行组合使用,例如:
[code]@Primary @Configuration @PropertySource(value = "classpath:application.properties", ignoreResourceNotFound = true)
如果要使用指定属性前缀”Prefix“,这时候还会使用到@ConfigurationProperties,提示依然会存在
解决方案是在POM文件中增加依赖
[code]<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-configuration-processor</artifactId> <optional>true</optional> </dependency>
导入依赖包后,异常提示消失,问题解决!
阅读更多相关文章推荐
- spring boot1.5以上版本@ConfigurationProperties取消location注解后的替代方案 cannot resolve method location
- spring boot1.5以上版本@ConfigurationProperties取消location注解后的替代方案
- 【spring Boot】spring boot1.5以上版本@ConfigurationProperties取消location注解后的替代方案
- Spring Boot之 Configuration Annotation Proessor not found in classpath解决方法
- Spring Boot1.4版本后@ConfigurationProperties注解舍弃location参数后的解决方式
- 【SpringBoot】Spring Boot Configuration Annotation Processor not found in classpath
- 解决:springboot中properties文件不能自动提示
- Spring Boot Configuration Annotion Processor not found in classpath
- idea中mybatis+spring boot, mapper 提示Could not autowire. No beans of … type found解决办法
- 解决Scala Play框架在Git Bash运行的异常:Could not find configuration file ../framework/sbt/sbt.boot.properties
- spring boot Configuration Annotation Proessor not found in classpath
- spring boot1.5以上版本@ConfigurationProperties取消location注解后的替代方案
- spring boot Configuration Annotation Proessor not found in classpath
- 解决QT5.2及以上版本连接mysql提示QMYSQL driver not download 问题
- spring boot Configuration Annotation Proessor not found in classpath
- spring提示需要jdk1.5以上版本问题
- Configuration Annotation Proessor not found in classpath解决;
- mybatis+spring boot, @Autowired 提示Could not autowire. No beans of … type found
- 解决Maven项目编译时提示:源值1.5已过时,将在未来所有版本中删除
- Apache2.2整合PHP5.3以上的版本时提示错误Cannot load php5apache2_2.dll into server解决方法