Boolean expression using Spring Profiles

We have the following annotation for a Component in a project:

@Profile("!department")

This means starting this component when the department is not an active profile. However, you can do something like:

@Profile("!department" || "datamigration" ) OR

 @Profile(["!department","datamigration"] )

Basically, I want to be able to speak, use this Componentif:

  • profile is not a department
    • OR
  • Profile - datamigration
+4
source share
1 answer

That should be enough

@Profile({"!department","datamigration"})
+8
source

Source: https://habr.com/ru/post/1689452/


All Articles