@ConfigurationProperties Spring Boot 配置注释处理器在类路径中找不到

2024-05-22

我尝试完成自定义属性春季启动.

我尝试通过创建一个简单的项目IntelliJ IDEA 2016.3:

  1. 创建了一个新的 Gradle 项目Spring Boot 初始化(我根本没有检查过任何东西)。
  2. 创建了一个新类Properties.

When I annotated it with @ConfigurationProperties, the next notification has appeared: notification

文档 http://docs.spring.io/spring-boot/docs/1.5.2.RELEASE/reference/html/configuration-metadata.html#configuration-metadata-annotation-processor说我应该将以下内容添加到我的项目中:

dependencies {
    optional "org.springframework.boot:spring-boot-configuration-processor"
}

compileJava.dependsOn(processResources)

之后,我尝试重建项目并在设置中启用注释处理器,但通知尚未消失。完成也不起作用(我创建了一个字符串my).


我有同样的问题。我使用idea 2017.2和gradle 4.1, 一些博客说你应该添加:

dependencies {
    optional "org.springframework.boot:spring-boot-configuration-processor"
}

但我把它改成了这样:

dependencies {
    compile "org.springframework.boot:spring-boot-configuration-processor"
}

并且警告消失了。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

@ConfigurationProperties Spring Boot 配置注释处理器在类路径中找不到 的相关文章

随机推荐