nacos-group / nacos-spring-boot-project

Nacos ECO Project for Spring Boot
Apache License 2.0
788 stars 424 forks source link

spring boot 2.7.15通过application.yml配置nacos.config.*不生效 #332

Open xishian opened 4 months ago

xishian commented 4 months ago

启动类

@SpringBootApplication
@NacosPropertySource(dataId = "${spring.application.name}", autoRefreshed = true)
public class MyApplication {

    public static void main(String[] args) {
        SpringApplication.run(MyApplication.class, args);
    }
}

配置文件application.yml

nacos:
  config:
    server-addr: 10.47.181.20:8848
    group: DEV_GROUP

这里配置的group是不会生效的,还是用的默认值DEFAULT_GROUP

如果这是预期的行为,建议从NacosConfigProperties中移除这些不会生效的配置项

fishandsheep commented 3 months ago

nacos-discovery-spring-boot-starter用的啥版本,我用springboot 2.7.18 + nacos-discovery-spring-boot-starter 0.2.12 没问题

GabbyMrH commented 3 weeks ago

我也出现这个问题,我是springboot2.6,单体整合压根不能用,用的是 nacos-config-spring-boot-starter,死活启动不起来