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:
18 votes, 30 watchers
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
@Configurationclass 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:
@Profileshould be able to define profiles to accomplish the 'and' scenario ("is duplicated by")@Profilemishandles "not" operand mixed with "&"18 votes, 30 watchers