Package io.quarkus.arc.profile
Annotation Interface IfBuildProfile
When applied to a bean class or producer method or field, the bean will only be enabled
if the Quarkus build time profile matches the rules of the annotation values.
Enabled when "dev" profile is active:
@ApplicationScoped
@IfBuildProfile("dev")
public class DevBean {
}
Enabled when both "build" and "dev" profiles are active:
@ApplicationScoped
@IfBuildProfile(allOf = {"build", "dev"})
public class BuildDevBean {
}
Enabled if either "build" or "dev" profile is active:
@ApplicationScoped
@IfBuildProfile(anyOf = {"build", "dev"})
public class BuildDevBean {
}
Enabled when both "build" and "dev" profiles are active and either "test" or "prod" profile is active:
@ApplicationScoped
@IfBuildProfile(allOf = {"build", "dev"}, anyOf = {"test", "prod"})
public class BuildDevBean {
}
This annotation may be put on a stereotype. A bean will be enabled if all the conditions
defined by the IfBuildProfile and UnlessBuildProfile annotations are satisfied.-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionString[]Multiple profiles names to enable a bean if all the profile names are active in Quarkus build time config.String[]Multiple profiles names to enable a bean if any the profile names is active in Quarkus build time config.A single profile name to enable a bean if a profile with the same name is active in Quarkus build time config.
-
Element Details
-
value
String valueA single profile name to enable a bean if a profile with the same name is active in Quarkus build time config.- Default:
""
-
allOf
String[] allOfMultiple profiles names to enable a bean if all the profile names are active in Quarkus build time config.- Default:
{}
-
anyOf
String[] anyOfMultiple profiles names to enable a bean if any the profile names is active in Quarkus build time config.- Default:
{}
-