简体   繁体   中英

Boolean expression using Spring Profiles

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

这应该足够了

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM