You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Stereotype @Profiles not merged [SPR-10812] #15438
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.
Indeed, at this point, we only expect one @Profile annotation or one custom annotation meta-annotated with @Profile... In case of multiple occurences of the latter, the behavior is essentially undefined.
We have a few related considerations for 4.0 anyway, so I'll put this onto the list for 4.0 RC1 still.
Activity
spring-projects-issues commentedon Aug 9, 2013
Juergen Hoeller commented
Indeed, at this point, we only expect one
@Profileannotation or one custom annotation meta-annotated with@Profile... In case of multiple occurences of the latter, the behavior is essentially undefined.We have a few related considerations for 4.0 anyway, so I'll put this onto the list for 4.0 RC1 still.
Juergen
spring-projects-issues commentedon Feb 11, 2016
Jakub Kubrynski commented
@juergen.hoeller Maybe this functionality could be controlled by@Profileattribute on last class in hierarchy? LikeThat will allow us to inherit profiles from custom stereotypes.