profile

fun profile(expression: String, init: BeanRegistrarDsl.() -> Unit)

Apply the nested block if the given profile expression matches the active profiles.

A profile expression may contain a simple profile name (for example "production") or a compound expression. A compound expression allows for more complicated profile logic to be expressed, for example "production & cloud".

The following operators are supported in profile expressions:

  • ! - A logical NOT of the profile name or compound expression

  • & - A logical AND of the profile names or compound expressions

  • | - A logical OR of the profile names or compound expressions

Please note that the & and | operators may not be mixed without using parentheses. For example, "a & b | c" is not a valid expression: it must be expressed as "(a & b) | c" or "a & (b | c)".

Parameters

expression

the profile expressions to evaluate