You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Koooooo-7 (via GitHub)" <gi...@apache.org> on 2023/05/08 07:35:22 UTC

[GitHub] [dubbo] Koooooo-7 commented on issue #12186: SpringBoot的application.yaml配置中超过两层的没提示

Koooooo-7 commented on issue #12186:
URL: https://github.com/apache/dubbo/issues/12186#issuecomment-1537895388

   这个可能是因为SpringBoot默认不会扫描非内部类的Config对象,如果需要被processor扫描到就需要有`@NestedConfigurationProperty`,并且是在每一个嵌套的对象想都要加上这个注解。
   所以解决办法可能是:
   1. 在Dubbo有`@Nested`的地方加上`@NestedConfigurationProperty`, 目前会对dubbo-common有侵入性(要引入spring-boot 依赖)。
   
   2. 添加`META-INF/additional-spring-configuration-metadata.json` [Adding Additional Metadata](https://docs.spring.io/spring-boot/docs/current/reference/html/configuration-metadata.html#appendix.configuration-metadata.annotation-processor.adding-additional-metadata), 可能要手动维护。目前SpringBoot自己内部的`additional-spring-configuration-metadata.json` 比如`flyway`的,也是自己手动维护。
   
   如果把2自动化可能要基于`@Nested`去做自己的AnnotationProcessor,或者自己参考springboot的processor完全实现hits功能生成`spring-configuration-metadata.json`。


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org