Spring Boot:有没有办法防止某些环境属性被覆盖?

Dav*_*ave 6 java configuration spring properties-file spring-boot

我正在使用 Spring Boot 及其外部配置功能: https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html

在我的应用程序中,我有一个application.properties具有默认配置的文件,例如:

my.property=one
other.property=two
Run Code Online (Sandbox Code Playgroud)

在生产和测试环境中,我使用 Spring Boot 的外部配置功能来覆盖某些属性。据我了解,这种配置概念贯穿整个Spring Boot,几乎任何选项都可以在外部配置。

这引出了我的问题:

  • 如果我有一些属性,但我不想公开这些属性以进行覆盖,该怎么办?
  • 是否有某种“黑名单”选项来防止所选属性列表被覆盖?