问题

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的更多相关文章

  1. idea中的springboot+gradle项目报错springboot configuration annotation processor not found in classpath

    idea中的springboot项目,打开某个类run.halo.app.config.properties.HaloProperties.java,报错(使用gradle编译): springboo ...

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

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

  3. 解决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

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

  5. 解决spring boot1.5以上版本@ConfigurationProperties提示“Spring Boot Configuration Annotation Processor not.."

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

  6. springboot 踩坑之路之 Configuration Annotation Proessor not found in classpath

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

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

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

  8. Spring Boot 踩坑之路之 Configuration Annotation Proessor not found in classpath

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

  9. spring boot Configuration Annotation Proessor not found in classpath

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

随机推荐

  1. stmt.executeQuery不执行解决办法

    感谢博主分享:https://blog.csdn.net/lxmky/article/details/4705698 今天在Eclipse下编写jsp网页时,出现一个问题,主要是stmt.execut ...

  2. flask项目在Linux运行

    依赖安装: 1.flask 2.flask_sqlalchemy --需要安装flask-mysqldb  安装时提示mysql_config not found ,使用:yum install my ...

  3. ubuntu18.04 kuebadm 安装 k8s-1.15.9

    ubuntu kubeadm 搭建kubernetes1.15.9 准备 update && 安装docker apt-get update apt install docker 修改 ...

  4. IDEA快捷键(未使用)

    1.ctrl Ctrl + Y 删除光标所在行 或 删除选中的行 Ctrl + W 递进式选择代码块.可选中光标所在的单词或段落,连续按会在原有选中的基础上再扩展选中范围 Ctrl + E 显示最近打 ...

  5. LaTeX bib 引用为 作者 + 年份

    将bib文件命名为ref.bib %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%% @Description: %%%%%%%% @Version: 1.0 %%%% ...

  6. 【Go】Golang实现gRPC的Proxy的原理

    背景 gRPC是Google开始的一个RPC服务框架, 是英文全名为Google Remote Procedure Call的简称. 广泛的应用在有RPC场景的业务系统中,一些架构中将gRPC请求都经 ...

  7. 纯代码实现wordpress图片本地化【5.2.2版本可用】

    最近用wordpress做了个网站,想复制些新闻过来用,但图片是别人的,就想怎么本地化,在网找到了方法,那就保存一下方法. 复制下面的代码,然后粘贴到你当前WordPress主题的模版函数(funct ...

  8. HCNP Routing&Switching之BGP基础

    前文我们了解了路由注入带来的问题以及解决方案相关话题,回顾请参考https://www.cnblogs.com/qiuhom-1874/p/15362604.html:今天我们来学习下新的路由协议BG ...

  9. 开放下载!2021 解锁 Serverless 从入门到实战大“橙”就

    Serverless 架构即将引领云计算的下一个十年已成行业共识.处于变革中的开发者,大多已从观望状态转向尝试阶段, 越来越多 Serverless 落地场景被解锁. "Serverless ...

  10. js 面向对象 动态添加标签

    有点逻辑 上代码 thml布局 点击查看代码 <!DOCTYPE html> <html lang="en"> <head> <meta ...