-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Description
I wanted to activate a feature in my app only when dev mode is active.
The class is not a cdi bean (OASFilter), so IfBuildProfile
does not help me.
I did not quite remember the manual way to check profiles, and tried to look it up in the doc.
ConfigProvider.getConfig().unwrap(SmallRyeConfig.class).getProfiles() states to use io.smallrye.config.SmallRyeConfig#getProfiles
to retrieve the currently active profiles.
However, that is a bit confusing imo. SmallRyeConfig#getProfiles is not a static method, and therer is no doc on that class on how to obtain an instance.
After a bit of searching I found ConfigUtils.getProfiles()
which does a simple unwrap / cast.
ConfigProvider.getConfig().unwrap(SmallRyeConfig.class)
.
The doc could be a bit more clearer on how to get the active profiles.
Implementation ideas
No response