Boolean expression using Spring Profiles

Viewed 710

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

@Profile("!department")

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

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

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

Basically I want a way to be able to say, use this Component if:

  • profile is NOT department
    • OR
  • profile is datamigration
1 Answers

This should be enough

@Profile({"!department","datamigration"})
Related