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
Allow to disable ConfigProperties #17063
Conversation
This workflow status is outdated as a new workflow run has been triggered. Failing Jobs - Building 63bbb3b
|
63bbb3b
to
3a78c1b
Compare
@geoand Hi, WDYT of this PR and related feature? |
Thanks for taking this up. I am not against it, but I would like to see how you intend to use this in a real application. Do you have an example? |
@geoand I described briefly one potential use case in the doc part here. Another example, let's say that I have applications A and B, the code is mostly common, only a slight part of the code is specific to A and B.
Since the difference between A and B is very small, I finally chose option # 2 and because of this choice, I face a situation where I have a specific part of the configuration of application A that is mapped thanks to |
I saw that, but the example is not exactly concrete. In the abstract it looks OK, but it doesn't help me to justify the extra complexity.
Again, can you show some specific example? |
Let's say that application A needs a configuration for a service that only A needs. The configuration of this specific configuration is mapped as next:
The related service:
Since With this PR proposal, I can add a build condition to the class
|
Understood, thanks |
fixes #17061
Motivation
The annotation
@ConfigProperties
and@ConfigPrefix
cannot be disabled once used which can be a problem when it maps an optional part of the configuration.Modifications
BuildItem
calledBuildExclusionsBuildItem
to encapsulate all the classes, methods and fields that have been excluded thanks to build time conditions.BuildExclusionsBuildItem#isExcluded
to potentially exclude what has been annotated with@ConfigProperties
and@ConfigPrefix
@ConfigProperties
if applied on a class and a@ConfigPrefix
if applied on a field or parameter.