How can I use @IfProfileValue to test if a Profile is active?
问题 So confusingly @IfProfileValue has nothing to do with @Profile or @ActiveProfiles . @Profile tests to see if a profile is active, @ActiveProfiles sets them as active, and @IfProfileValue allows you to check things in Spring Environment . Wut? I'd deprecate all of them and add new ones @IfEnvironment , @IfProfile , and @ActivateProfiles . Commentary aside, how can I use @IfProfileValue to detect whether i have a profile active? I am not using Spring Boot on this project, at this time. Answers