-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Description
Manuel Jordan opened SPR-15634 and commented
The current @Profile's value attribute behaves how an OR
Thus having the following:
@Component
@JmxProfile
@FileProfile
@ManagedResource(description="Admin SimpleFileReaderLoggingWriter")
public class SimpleFileReaderLoggingWriterJmx {or
@Component
@Profile(value={"jmx","file"})
@ManagedResource(description="Admin SimpleFileReaderLoggingWriter")
public class SimpleFileReaderLoggingWriterJmx {It behaves: use this bean when the profile is either jmx or file (mostly for the second scenario, seems I need other approach for the first scenario, I mean, an annotation that wraps other annotations)
Seems we need a new attribute that behaves how an AND. It to represents:
use this bean when the profiles are jmx and file
Sadly it is not a @Configuration class where I am able to use the @Profile together with the @Configuration and @Bean to represent the AND scenario. But here we are in the business or model area.
Not sure if exists other approach to accomplish this.
Thank you.
Affects: 4.3 GA, 4.3.8
Reference URL: https://stackoverflow.com/questions/38133808/spring-multiple-profiles-active
Issue Links:
- Support AND operator in @Profile annotation [SPR-12458] #17063 Support AND operator in
@Profileannotation ("duplicates")