@Configuration @PropertySource("xx-${spring.profiles.active}.properties") public class TopologyContext {}
@Bean
@Profile({"uat", "prod"})
设置默认值很简单 @Value("${NamesrvAddr:192.168.0.1}") private String namesrvAddr;
src/main/resources/xx-dev.properties
VM arguments -Dspring.profiles.active=dev