Skip to content

studeyang/nacos-config-spring-boot-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Why do this?

Description

Yaml does not support multiple profiles.

When Nacos configuration is:

test1:
  config: 2

---
spring:
  profiles: alpha
test1:
  config: alpha

---
spring:
  profiles: beta
test1:
  config: beta

And I set -Dspring.profiles.active=alpha and get property named test1.config, nacos-spring-boot gave me the result beta.

Expected

alpha

See: nacos-group/nacos-spring-boot-project#226

Usage

@PrepareConfigurations({"common_database.yml", "common_eureka.yml"})
public class WebApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(WebApplication.class, args);
        context.getEnvironment();
    }

}

About

nacos 增强

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages