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时,依赖项应声明为可选,如以下示例所示:
注:简书迁移