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

ArC - rework the way the build profile/property producer beans are disabled #17583

Closed
mkouba opened this issue Jun 1, 2021 · 3 comments · Fixed by #17972
Closed

ArC - rework the way the build profile/property producer beans are disabled #17583

mkouba opened this issue Jun 1, 2021 · 3 comments · Fixed by #17972
Assignees
Labels
area/arc Issue related to ARC (dependency injection) kind/bug Something isn't working
Milestone

Comments

@mkouba
Copy link
Contributor

mkouba commented Jun 1, 2021

Currently, we add @Alternative and remove @AlternativePriority if present. However, if a user declares an @Alternative producer and enables it via quarkus.arc.selected-alternatives then @UnlessBuildProperty and friends would have no effect.

We could:

  1. Remove @Produces and all scopes and known qualifiers/stereotypes (due to Simplified Producer Method Declaration),
  2. Remove all annotations (just in the context of AnnotationStore),
  3. Introduce a new annotation, e.g. @VetoedProducer (note that @javax.enterprise.inject.Vetoed has @Target({ ElementType.TYPE, ElementType.PACKAGE })).
@mkouba mkouba added the kind/bug Something isn't working label Jun 1, 2021
@quarkus-bot quarkus-bot bot added the area/arc Issue related to ARC (dependency injection) label Jun 1, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Jun 1, 2021

/cc @manovotn

@mkouba mkouba added this to the 2.1 - main milestone Jun 1, 2021
@manovotn
Copy link
Contributor

manovotn commented Jun 2, 2021

Introduce a new annotation, e.g. @VetoedProducer (note that @javax.enterprise.inject.Vetoed has @target({ ElementType.TYPE, ElementType.PACKAGE })).

A bit outside of this question but do you think it would be worth it to expand CDI spec to allow usage of @Vetoed on methods/fields? I think it might be worth it.

Otherwise, option 3 sounds like a way to go.

@mkouba
Copy link
Contributor Author

mkouba commented Jun 2, 2021

A bit outside of this question but do you think it would be worth it to expand CDI spec to allow usage of @Vetoed on methods/fields? I think it might be worth it.

I'm not sure TBH. The original intent of @Vetoed was probably to exclude classes from an explicit bean archive (bean discovery all), i.e. those that would otherwise end up as @Dependent beans. For sure you can use it for tests etc. but the majority of use cases was probably different. See also https://issues.redhat.com/browse/CDI-50.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection) kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants