Spring Cloud如何排除BootstrapConfiguration

huangapple go评论119阅读模式
英文:

Spring Cloud how to exclude BootstrapConfiguration

问题

有没有一种方法可以通过org.springframework.cloud.bootstrap.BootstrapConfiguration键在META-INF/spring.factories文件中排除特定的BootstrapConfiguration声明?

我没有找到任何关于这方面的文档,尽管我看到org.springframework.cloud.bootstrap.BootstrapConfiguration注解有一个exclude字段,但对于如何使用它,我不太清楚。

英文:

Is there a way to exclude a specific BootstrapConfiguration declared in a META-INF/spring.factories file with the org.springframework.cloud.bootstrap.BootstrapConfiguration key?

I wasn't able to find any documentation about it, even though I see the org.springframework.cloud.bootstrap.BootstrapConfiguration annotation has an exclude field, it is not clear to me exactly how it should be used.

答案1

得分: 1

根据您想要排除的类别,您可以设置以下内容以进行禁用:

spring.cloud.azure.appconfiguration.enabled=false
英文:

According to the class you want to exclude you can set the following to disable it

spring.cloud.azure.appconfiguration.enabled=false

答案2

得分: 0

这在Spring Boot中很简单。如果你的应用程序文件位置是 "/src/main/resources/bootstrap.yml",那么它会在应用程序启动时自动执行。

Spring Cloud如何排除BootstrapConfiguration

英文:

It is simple in spring boot. If application your file location is "/src/main/resources/bootstrap.yml" then it is automatically execute when your application start.

Spring Cloud如何排除BootstrapConfiguration

huangapple
  • 本文由 发表于 2020年4月7日 23:34:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/61083747.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定