ConfigurationProperties用什么依赖
时间: 2023-10-12 07:08:04 浏览: 100
为了使用@ConfigurationProperties注解,需要导入spring-boot-configuration-processor依赖。可以在项目的pom.xml文件中添加以下依赖:
```xml
<!--导入配置文件处理器,配置文件进行绑定就会有提示-->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-configuration-processor</artifactId>
<optional>true</optional>
</dependency>
```
这样就可以使用@ConfigurationProperties注解了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [SpringBoot使用@ConfigurationProperties完成配置文件yml与properties的注入](https://blog.csdn.net/qq_38530648/article/details/119865209)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [@ConfigurationProperties注解使用方法(源代码)](https://download.csdn.net/download/weixin_46411355/87400774)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [使用@ConfigurationProperties注解时需要引入的依赖](https://blog.csdn.net/abckingaa/article/details/115254705)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文