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 ...
随机推荐
- web、app、小程序测试异同点
http://www.spasvo.com/Company/news_show.asp?id=702 https://blog.csdn.net/weixin_43489515/article/det ...
- 『GoLang』语法基础
标识符 字母或下划线开头 之后只能出现数字.字母.下划线 大小写敏感 Go语言关键字 break default func interface select case defer go map str ...
- 【Vue】淘气三千问之 data为什么是函数而不是对象?这河狸吗
朋友,当你提出以上问题的时候建议你先去复习下原型链的知识 但是我好人做到底直接就讲了吧,我们先看一下下面的这段代码: function Component () { this.data = this. ...
- P7324-[WC2021]表达式求值【dp】
正题 题目链接:https://www.luogu.com.cn/problem/P7324 题目大意 给一个只包含\(m\)个值的表达式,\(<\)表前后取最小值,\(>\)表前后取最大 ...
- 实例:建立图书借阅系统的UML模型
1.需求分析 图书借阅系统的组成 2.具体的功能详细描述: (1)管理员登录系统,进入借书工作状态,等待借书处理. (2)读者找到所需图书,在借书处上刷卡机上刷卡. (3)管理员对借阅证进行资格审查. ...
- 【C++ Primer Plus】编程练习答案——第6章
1 void ch6_1() { 2 using namespace std; 3 char ch; 4 while ((ch = cin.get()) != '@') { 5 if (isdigit ...
- Unity——可复用背包工具
Unity可复用背包工具 Demo展示 设计思路 游戏中有非常多的背包样式,比如玩家道具背包,商城,装备栏,技能栏等:每个形式的背包都单独写一份逻辑会非常繁琐,所以需要有一套好用的背包工具: 这些背包 ...
- 关于VS中的无法解析的外部符号问题
利用caffe的源码编译出的caffe.lib静态链接库里面就包含了源码里面的那些函数的接口i,所以如果在程序中使用的是源码的话,就不需要在链接器里面再添加此静态链接库了 对于无法解析的外部符号,首先 ...
- centos8安装MySQL8——通过yum
centos8上通过yum安装MySQL,过程简单,不易出错 1.检查系统是否已安装MySQL相关,如果有则全部清除干净 #列出MySQL相关的安装包 rpm -qa | grep mysql #依次 ...
- 微软 SqlHelper代码、功能、用法介绍:高效的组件
数据访问组件SqlHelper数据访问组件是一组通用的访问数据库的代码,在所有项目中都可以用,一般不需要修改.本节使用的是Microsoft提供的数据访问助手,其封装很严密,且应用简单. 首先要先添加 ...