SpringBoot中使用@ConfigurationProperties提示:Configuration Annotation Processor not found in classpath
问题
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>
SpringBoot中使用@ConfigurationProperties提示:Configuration Annotation Processor not found in classpath的更多相关文章
- idea中的springboot+gradle项目报错springboot configuration annotation processor not found in classpath
idea中的springboot项目,打开某个类run.halo.app.config.properties.HaloProperties.java,报错(使用gradle编译): springboo ...
- 使用@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 boot1.5以上版本@ConfigurationProperties提示“Spring Boot Configuration Annotation Processor not.."
Springboot1.5以上版本,在使用 @ConfigurationProperties注解的时候会提示“Spring Boot Configuration Annotation Processo ...
- springboot 踩坑之路之 Configuration Annotation Proessor not found in classpath
1.出现spring boot Configuration Annotation Proessor not found in classpath的提示是在用了@ConfigurationPropert ...
- Spring Boot Configuration Annotation Proessor not found in classpath解决办法
From: https://www.cnblogs.com/whtgjy/p/9438317.html 出现spring boot Configuration Annotation Proessor ...
- Spring Boot 踩坑之路之 Configuration Annotation Proessor not found in classpath
1. 出现spring boot Configuration Annotation Proessor not found in classpath的提示是在用了@ConfigurationProper ...
- spring boot Configuration Annotation Proessor not found in classpath
出现spring boot Configuration Annotation Proessor not found in classpath的提示是在用了@ConfigurationPropertie ...
随机推荐
- python学习笔记(六)-集合
集合是一个无序不重复元素的集.基本功能包括关系测试和消除重复元素.集合对象还支持union(联合),intersection(交),difference(差)和sysmmetric differenc ...
- Python守护线程简述
thread模块不支持守护线程的概念,当主线程退出时,所有的子线程都将终止,不管它们是否仍在工作,如果你不希望发生这种行为,就要引入守护线程的概念. threading模块支持守护线程,其工作方式是: ...
- 『Python』matplotlib初识
1. 核心原理 使用matplotlib绘图的原理,主要就是理解figure(画布).axes(坐标系).axis(坐标轴)三者之间的关系. 下面这幅图更详细: 以"美院学生张三写生画画&q ...
- hadoop生态之面试题篇
一.hdfs的高可用 1.先说下自己的理解, 正常的hdfs有namenode,datanode,secondnamenode,但是second name node 不是真正意义上的namenode备 ...
- 关于我刚开始学习c语言的这档事
关于我刚开始学习C语言的这档事 就在9月20日下午,记得王老师曾提及三类人,一类专注于自己内心的感受:一类人专注于探索与创造:还有一类专注于效率的最大化.思绪不禁回想到11号至今的学习过程-- 我的学 ...
- 深入浅出WPF-08.Event( 事件)01
事件(Event) 首先我们来继续说一下UI组件树,因为WPF事件 的路由环境就是组件树.WPF中的树有两种,一种是逻辑树(Logical Tree),一种是可视元素树(Visual Tree).逻辑 ...
- Snipaste屏幕截图的使用
什么是Snipaste Snipaste是一款屏幕截图软件 类似于微信的截图 Snipaste使用步骤 百度搜索Snipaste 如图 点击 根据自己电脑系统选择安装 下载完成后 解压到当前文件夹 点 ...
- Rafy 框架 - 实体支持只更新部分变更的字段
Rafy 快一两年没有大的更新了.并不是这个框架没人维护了.相反,主要是因为自己的项目.以及公司在使用的项目,都已经比较稳定了,也没有新的功能添加.但是最近因为外面使用了 Rafy 的几个公司,找到我 ...
- 【Azure 云服务】Azure Cloud Service 为 Web Role(IIS Host)增加自定义字段 (把HTTP Request Header中的User-Agent字段增加到IIS输出日志中)
问题描述 把Web Role服务发布到Azure Cloud Service后,需要在IIS的输出日志中,把每一个请求的HTTP Request Header中的User-Agent内容也输出到日志中 ...
- (googlechrome)未知错误导致安装失败,如果googlechrome....
https://jingyan.baidu.com/article/ea24bc39ffb699da63b33147.html#5827690-tsina-1-63512-fe183374908e7 ...