zoukankan      html  css  js  c++  java
  • @configurationProperties注解时 idea弹出 Spring Boot Annotion processor not found in classpath

     

    @ConfigurationProperties(prefix="") 没有指定 classpath 时,IDEA 提示没有找到 classpath。

    原因:

    1--》在没指定路劲的情况下,默认在 resource 下的 applications.properties (yml) 中查找,

    如果找到则返回值,如果没有找到则返回默认值null/0/false…所以不用管它也是

    可以正常运行的, 有时候无法注释数据为null

    2--》加入依赖:
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-configuration-processor</artifactId>
    <optional>true</optional>
    </dependency>
    之后如果ConfigurationProperties继续报错:Not registered via @EnableConfigurationProterties or marked as……
    解决办法:加上@Component注解

    可以关闭 IDEA 的提示:

    setting 下搜索 spring,找到 springBoot 取消勾选 show notification panel

    controller的使用

  • 相关阅读:
    括号
    vue 框架原理
    Angular 1.x 框架原理
    ES5的数组方法
    js 对象细节
    《高性能网站建设进阶指南》笔记
    vue 运行时 + 编译器 vs. 只包含运行时
    vue-loader 细节
    vue 错误处理
    移动web touch事件
  • 原文地址:https://www.cnblogs.com/wzb-liumangtu/p/12608458.html
Copyright © 2011-2022 走看看