Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@Profile should be able to define profiles to accomplish the 'and' scenario [SPR-15634] #20193

Closed
spring-projects-issues opened this issue Jun 7, 2017 · 2 comments
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: duplicate A duplicate of another issue type: task A general task

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jun 7, 2017

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:

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Jun 7, 2017

Juergen Hoeller commented

Looks like a duplicate of #17063?

@spring-projects-issues
Copy link
Collaborator Author

Manuel Jordan commented

Yes, practically the same scenario. But I think is important that perhaps a new annotation for the non @Configuration classes should be created.

@spring-projects-issues spring-projects-issues added in: core Issues in core modules (aop, beans, core, context, expression) status: duplicate A duplicate of another issue type: task A general task labels Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: duplicate A duplicate of another issue type: task A general task
Projects
None yet
Development

No branches or pull requests

1 participant