美文网首页Springboot入门
Spring Boot Configuration Annota

Spring Boot Configuration Annota

作者: 生死2019 | 来源:发表于2018-12-25 18:29 被阅读0次

IDEA报错后,点开文档内容如下:

B.3 Generating Your Own Metadata by Using the Annotation Processor
You can easily generate your own configuration metadata file from items annotated with @ConfigurationProperties by using the spring-boot-configuration-processor jar. The jar includes a Java annotation processor which is invoked as your project is compiled. To use the processor, include a dependency on spring-boot-configuration-processor.
With Maven the dependency should be declared as optional, as shown in the following example:

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-configuration-processor</artifactId>
    <optional>true</optional>
</dependency>
添加依赖后出现如下提示: 成功解决问题

附上文档中文翻译(来自谷歌浏览器):

B.3使用注释处理器生成自己的元数据
您可以@ConfigurationProperties使用spring-boot-configuration-processorjar 注释的项目轻松生成自己的配置元数据文件 。jar包含一个Java注释处理器,在您编译项目时调用该处理器。要使用处理器,请包含依赖项 spring-boot-configuration-processor。
使用Maven时,依赖项应声明为可选,如以下示例所示:

相关文章

网友评论

    本文标题:Spring Boot Configuration Annota

    本文链接:https://www.haomeiwen.com/subject/asqqlqtx.html