解决spring boot1.5以上版本@ConfigurationProperties提示“Spring Boot Configuration Annotation Processor not.."
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.."的更多相关文章
- 【spring Boot】spring boot1.5以上版本@ConfigurationProperties取消location注解后的替代方案
前言 =========================================== 初步接触Spring Boot ===================================== ...
- spring boot1.5以上版本@ConfigurationProperties取消location注解后的替代方案 cannot resolve method location
问题 在spring boot(版本1.5.1.RELEASE)项目中,当准备映射自定义的配置文件属性到类中的时候,发现原本的@ConfigurationProperties注解已将location属 ...
- 使用@ConfigurationProperties注解 提示 “Spring Boot Configuration Annotation Processor not found in classpath ”
解决方案: 在 pom.xml 添加依赖 <dependency> <groupId>org.springframework.boot</groupId> < ...
- 解决Spring Boot Configuration Annotation Processor not found in classpath
问题截图: 解决方式: 在pom.xml文件中添加这些依赖 <dependency> <groupId>org.springframework.boot</groupId ...
- spring boot configuration annotation processor not found in classpath
<dependency> <groupId> org.springframework.boot </groupId> <artifactId> spri ...
- Spring Boot Configuration Annotation Proessor not found in classpath解决办法
From: https://www.cnblogs.com/whtgjy/p/9438317.html 出现spring boot Configuration Annotation Proessor ...
- SpringBoot中使用@ConfigurationProperties提示:Configuration Annotation Processor not found in classpath
问题 Springboot1.5以上版本,在使用 @ConfigurationProperties注解的时候会提示Spring Boot Configuration Annotation Proces ...
- spring boot Configuration Annotation Proessor not found in classpath
出现spring boot Configuration Annotation Proessor not found in classpath的提示是在用了@ConfigurationPropertie ...
- spring boot1.3.0版本及以上版本profile指定参数无法被打入
现象:小于1.3.0版本如1.2.6的spring boot, 当指定profile进行参数打入的时候,发现没有问题,但是比如改用1.3.0,1.3.1及其以上版本的时候,发现参数打不进去,经过比对s ...
随机推荐
- 伟程君解决端口被占用问题(接口jmeter 本地端口被占用完了,jmeter报错的问题)(亲测是可以的)
1.在目录下创建文件local.conf(没有就创建目录和文件) touch /etc/sysctl.d/local.conf mkdir(创建文件夹) touch(创建文件) 2.往local.co ...
- httpcomponent框架MultipartEntityBuilder addTextBody中文乱码
版本4.5.6 String url = "https://172.16.3.50:8111/api/tts/offline"; HttpPost httpPost = new H ...
- VMware的包格式vmdk转换为virtualBox的ova
使用winxp的vmdk作为案例 1 使用vmvare导入vmdk的winxp,点击文件---->导出为ovf 2 找到生成的ovf文件 3 打开virtualBox 管理---->导入虚 ...
- jinja 模板渲染路径坑
路径中不能用上一级目录../
- KMP算法JS实现
参考阮一峰的<字符串匹配的KMP算法>,用JS实现一版,备忘~ // 主串 let str1 = 'BBC ABCDAB ABCDABCDABDEDC'; // 模式串 let str2 ...
- python is 和 == 区别(8)
在python中is和==都说常用的运算符之一,主要用于检测两个变量是否相等,返回True或者False,具体区别在哪呢? 一.前言 在讲解is和==区别直接先讲解一下内置函数id(),其实在文章 p ...
- 第1/7Beta冲刺
1.团队成员 成员姓名 成员学号 秦裕航 201731062432(组长) 刘东 201731062227 张旭 201731062129 王伟 201731062214 2.SCRU部分 2.1各成 ...
- 关于close_wait状态的理解
以web服务器产生大量的close_wait状态为例 1.close_wait状态介绍: 客户端主动关闭连接,服务器接收到客户端的FIN,但是还没有发送自己的FIN,此时的状态为close_wait状 ...
- Java开发笔记(一百零九)XML报文的定义和解析
前面介绍了JSON格式的报文解析,虽然json串短小精悍,也能有效表达层次结构,但是每个元素只能找到对应的元素值,不能体现更丰富的样式特征.比如某个元素除了要传输它的字符串文本,还想传输该文本的类型. ...
- 不一样的go语言-go缺少的语言特性
相信很多从其他语言转向go语言的人,或者是几乎所有初学go语言的人(我相信目前还没有学校将go作为教学语言,所以未来的IT工程师的第一语言都不会是go),都会在学习的过程中将go与自己的第一语言. ...