Java 运行时对spring概要文件进行故障排除

Java 运行时对spring概要文件进行故障排除,java,spring,spring-boot,spring-profiles,Java,Spring,Spring Boot,Spring Profiles,我目前正在维护一个遗留代码库,其中在应用程序上下文中指定了以下Spring概要文件配置: spring.profiles.active=addressbook-[usermanager|webservices],entrypoint-[form|saml] 问题是:如何读取本例中为spring.profiles.active指定的内容 我认为这里有4种可能的概要定义,对吗?即: addressbook-usermanager, entrypoint-form addressbook-webse

我目前正在维护一个遗留代码库,其中在应用程序上下文中指定了以下Spring概要文件配置:

spring.profiles.active=addressbook-[usermanager|webservices],entrypoint-[form|saml]
问题是:如何读取本例中为
spring.profiles.active
指定的内容

我认为这里有4种可能的概要定义,对吗?即:

addressbook-usermanager, entrypoint-form
addressbook-webservices, entrypoint-form
addressbook-usermanager, entrypoint-saml
addressbook-webservices, entrypoint-saml
有没有一种方法可以打开日志来查看选择了哪个概要文件,以及为特定概要文件加载了哪些bean?如果没有,为什么他们没有上膛

我正在仔细阅读和我能找到的任何其他类型的文档,但我还没有找到任何特定于上述概要文件规范语法的内容。是否有可用的文件


谢谢

我不知道Spring中是否支持上述语法。我相信您描述的配置将为您提供两个活动配置文件:

  • addressbook-[usermanager|webservices]
  • entrypoint-[form|saml]
您可以使用查询当前活动的配置文件。要获得
环境
实例,可以使用Spring的自动布线或工具


您可能还需要查看
ProfileCondition
。它没有日志记录,但是您可以使用调试器根据bean的
@Profile
注释查看bean被包括或排除。

没关系。我没有意识到这仅仅意味着我必须在配置中明确选择每个选项中的一个。正如您正确提到的,Spring与此无关/不关心其中的名称。所以是的。。。OSI第8层错误。再次感谢!。。。我需要咖啡XD。