Skip to content

Stereotype @Profiles not merged [SPR-10812] #15438

Closed
@spring-projects-issues

Description

@spring-projects-issues

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:

Referenced from: commits aecf60d

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions