We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如题,使用@NacosConfigurationProperties将配置注入到POJO类时,无法注入相关值。 Type: bug report or feature request
相关组件版本如下:
SpringBoot: 2.5.2 <dependency> <groupId>com.alibaba.nacos</groupId> <artifactId>nacos-spring-context</artifactId> <version>1.1.1</version> </dependency>
Config Class如下:
@Data @Configuration @NacosConfigurationProperties(prefix = "simple", autoRefreshed=true, type = ConfigType.YAML, ignoreNestedProperties = true, dataId = "${nacos.config.dataId}", groupId = "${nacos.config.groupId}") public class SimpleObjConfig { private String name; private String school; private Integer age; }
yaml配置如下:
@NacosConfigurationProperteis注入效果如下:
使用@NacosConfigurationiProperties能正确注入相关配置的值,并且在配置中心修改后,Config Bean中的值是可以动态改变的。
The text was updated successfully, but these errors were encountered:
这个解决了吗 我也碰到同样的问题了
Sorry, something went wrong.
我的可以啊,一开始我的也不行,后来我发现@NacosConfigurationProperties默认的文件类型是properties,你需要指定yml才可以,我的版本是 com.alibaba.boot nacos-config-spring-boot-starter 0.2.6
No branches or pull requests
Issue Description
如题,使用@NacosConfigurationProperties将配置注入到POJO类时,无法注入相关值。
Type: bug report or feature request
相关组件版本如下:
Describe what happened (or what feature you want)
Config Class如下:
yaml配置如下:

@NacosConfigurationProperteis注入效果如下:

Describe what you expected to happen
使用@NacosConfigurationiProperties能正确注入相关配置的值,并且在配置中心修改后,Config Bean中的值是可以动态改变的。
How to reproduce it (as minimally and precisely as possible)
Tell us your environment
Anything else we need to know?
The text was updated successfully, but these errors were encountered: