Springboot1.5以上版本,在使用 @ConfigurationProperties注解的时候会提示“Spring Boot Configuration Annotation Processor not found in classpath”,

这是因为新版本已经取消了对location的支持,替代方案是使用
@Configuration和@PropertySource进行组合使用,例如:
@Primary
@Configuration
@PropertySource(value = "classpath:application.properties", ignoreResourceNotFound = true)
如果要使用指定属性前缀”Prefix“,这时候还会使用到@ConfigurationProperties,提示依然会存在

解决方案是在POM文件中增加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
导入依赖包后,异常提示消失,问题解决!
---------------------
作者:solin418
来源:CSDN
原文:https://blog.csdn.net/weixin_41846320/article/details/81566660
版权声明:本文为博主原创文章,转载请附上博文链接!

解决spring boot1.5以上版本@ConfigurationProperties提示“Spring Boot Configuration Annotation Processor not.."的更多相关文章

  1. 【spring Boot】spring boot1.5以上版本@ConfigurationProperties取消location注解后的替代方案

    前言 =========================================== 初步接触Spring Boot ===================================== ...

  2. spring boot1.5以上版本@ConfigurationProperties取消location注解后的替代方案 cannot resolve method location

    问题 在spring boot(版本1.5.1.RELEASE)项目中,当准备映射自定义的配置文件属性到类中的时候,发现原本的@ConfigurationProperties注解已将location属 ...

  3. 使用@ConfigurationProperties注解 提示 “Spring Boot Configuration Annotation Processor not found in classpath ”

    解决方案: 在 pom.xml 添加依赖 <dependency> <groupId>org.springframework.boot</groupId> < ...

  4. 解决Spring Boot Configuration Annotation Processor not found in classpath

    问题截图: 解决方式: 在pom.xml文件中添加这些依赖 <dependency> <groupId>org.springframework.boot</groupId ...

  5. spring boot configuration annotation processor not found in classpath

    <dependency> <groupId> org.springframework.boot </groupId> <artifactId> spri ...

  6. Spring Boot Configuration Annotation Proessor not found in classpath解决办法

    From: https://www.cnblogs.com/whtgjy/p/9438317.html 出现spring boot Configuration Annotation Proessor ...

  7. SpringBoot中使用@ConfigurationProperties提示:Configuration Annotation Processor not found in classpath

    问题 Springboot1.5以上版本,在使用 @ConfigurationProperties注解的时候会提示Spring Boot Configuration Annotation Proces ...

  8. spring boot Configuration Annotation Proessor not found in classpath

    出现spring boot Configuration Annotation Proessor not found in classpath的提示是在用了@ConfigurationPropertie ...

  9. spring boot1.3.0版本及以上版本profile指定参数无法被打入

    现象:小于1.3.0版本如1.2.6的spring boot, 当指定profile进行参数打入的时候,发现没有问题,但是比如改用1.3.0,1.3.1及其以上版本的时候,发现参数打不进去,经过比对s ...

随机推荐

  1. [转]C++ 使用 curl 进行 http 请求(GET、POST、Download)的封装

    原文连接:https://www.cnblogs.com/oftenlin/p/9478067.html CommonTools.h   /* * CommonTools.h * * Created ...

  2. saltstack执行state.sls耗时长的坑

    一直用的 jenkins + saltstack 自动化构建发布项目,一共也就不超过20台服务器,奈何运行时间越来越慢,并且负载越来越高(这里大部分都是使用state模块),但是不用state模块效率 ...

  3. 使用肘部法确定k-means均值的k值

    import numpy as np from sklearn.cluster import KMeans from scipy.spatial.distance import cdist impor ...

  4. Python的传递引用

    在研究神经网络的反向传播的时候,不解一点,就是修改的是神经网络的paramets,为什么影响内部的神经元(层),比如Affine层:因为除了创建的时候,使用params作为Affine层的构造函数参数 ...

  5. Appium脚本(2):元素检测

    场景: 有的按钮在第一次打开时显示,之后就不显示了,如更新提示.特性介绍等,面对这样的场景写了如下脚本,增加脚本的复用性. no_element_exception_2.py from appium ...

  6. python实践项目五:操作剪贴板-pyperclip模块

    描述:读取剪贴板的内容,修改该内容,再将修改后的内容重新写进剪贴板 注意:执行程序代码前需保证剪贴板有内容,可复制以下内容来测试: Lists of animals Lists of aquarium ...

  7. FDD与TDD的区别

    LTE通常分为FDD LTE和TDD LTEFDD,频分双工(Frequency Division Duplexing)我和你通信,像广播一样,只能我说你听,是单工:像对讲机一样,同一时间只能一方说, ...

  8. C++和C API调用

    c++是C的超集,不可避免的要兼容C的特性,C++在C基础山的拓展部分叫做C with class,同时C++有自己特有的属性比如模板template. C并不完全是C++的子集. 那么如何在C/C+ ...

  9. layui 监听switch事件

    <input type="checkbox" lay-filter="common_change_status" name="switch&qu ...

  10. Java开发笔记(一百四十)JavaFX的选择框

    与Swing一样,JavaFX依然提供了三种选择框,它们是复选框CheckBox.单选按钮RadioButton.下拉框ComboBox,分别说明如下: 一.复选框CheckBox复选框允许同时勾选多 ...