Closed
Description
Artem opened SPR-12458 and commented
As of v4.1.2 @Profile annotation does not support AND operator, being OR by definition.
This significantly limits it's applicability in our project since we have profiles: PROD, TEST, CONFIG1, CONFIG2, etc. And we want to have beans autowired based in PROD && CONFIG1 style to be able to setup config1 in production and TEST && CONFIG1 to setup same profile for test.
The good example would be config being MQENABLED profile. Which in case of production will be set on @Configuration
class with RabbitTemplate bean configuration, but for test we want to have our own implementation of AmqpTemplate (instead of RabbitTemplate).
Affects: 4.1.2
Issue Links:
- @Profile should be able to define profiles to accomplish the 'and' scenario [SPR-15634] #20193
@Profile
should be able to define profiles to accomplish the 'and' scenario ("is duplicated by") - Improve testability of new Profiles support [SPR-16962] #21500 Improve testability of new Profiles support
- Profile activation: not operator does not work consistently [SPR-16465] #21010 Profile activation: not operator does not work consistently
- @Profile mishandles "not" operand mixed with "&" [SPR-17606] #22138
@Profile
mishandles "not" operand mixed with "&" - Support inclusive profiles [SPR-13939] #18511 Support inclusive profiles
18 votes, 30 watchers