我正在使用spring-cloud-starter-consul-config'. For this I defined my properties inbootstrap.yml. But I need to use profile specific consul properties which is not working inbootstrap.yml`.
此外,我需要使用自定义属性文件而不是bootstrap.yml,以便可以使用@PropertySource加载此自定义文件。有什么想法吗?
@SpringBoogApplication
@EnableAutoconfiguration
public class myApplication {
}bootstrap.yml
environments:
dev:
spring:
cloud:
consul:
host: dev-consul
port: 8500发布于 2018-02-02 17:43:28
创建第二个application-{env}.yml和bootstrap-{env}.yml文件。
然后构建jar并启动java -jar app.jar -Dspring.profiles.active={env}
https://stackoverflow.com/questions/36199873
复制相似问题