Description
Emerson Farrugia opened SPR-10812 and commented
I created environment stereotype annotations @Production
, @Staging
, and @Development
to easily control which environment a few beans are available in. These annotations in turn have @Profile
("somestring") as a meta-annotation.
I've hit an issue where the same @Component
might be available in multiple environments, but not all of them, e.g.
@Staging
@Production
@Service
public class SomeService { ...
The org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider only sees one of the @Profile
meta-annotations, and I don't see an obvious pattern as to which it's picking.
Is it possible to compute the disjunction of all available profiles in this case? Profile negation might be fun.
Affects: 3.2.3
Issue Links:
- Custom @Profile annotations not working on @Configuration classes [SPR-11808] #16428 Custom
@Profile
annotations not working on@Configuration
classes
Referenced from: commits aecf60d