官方文档
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>
大概意思是你可以通过@ConfigurationProperties 这个注解简单生成你的配置元数据,但是这个注解需要这么一个jar包,你只要在pom文件中添加这个依赖就可以了,清楚简单