Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 filter dependencies in multi-build mode #16600
Allow to filter dependencies in multi-build mode #16600
Changes from all commits
bcc2e07
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give a reasonable example of having configured
optionalDependencies
and wishingfilterOptionalDependencies
to be false?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aloubyansky No there is no such example. But I need a mechanism to enable the feature in order to distinguish, the case where we don't want to include any optional dependencies by not setting
optionalDependencies
intentionally and the case whereoptionalDependencies
has not been set after migrating an application (what I called "backward compatibility reasons")There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like there is some config redundancy. I.e. if you specify which dependencies you want to keep, it implies the rest of the optional deps you will want to be filtered out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure, I get what you mean. This is only a flag to enable the feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't use this flag, there are several tests with optional dependencies that fail because it will filter out all the optional dependencies
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's probably a sign of a bug? Why would all the optional dependencies be filtered out w/o it?
What I'm saying is if you configure
optionalDependencies
, you list the dependencies you want to keep. Which means the rest of the optional dependencies aren't desired, right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aloubyansky No it is actually intended, let's say that you want to build your application twice with two different Quarkus profiles foo and bar. The code for bar needs one additional library "ext-bar". So the dependency "ext-bar" will be marked as optional, foo won't define anything for
includedOptionalDependencies
as it doesn't need any optional dependencies while bar will setext-bar
asincludedOptionalDependencies
. Do you see what I mean?That's right, it also means that if no
optionalDependencies
are configured andfilterOptionalDependencies
has been set totrue
, then it will not include any optional dependencies.Here are the use cases:
filterOptionalDependencies
set tofalse
(the default value), it will behaves like before in other words, the optional dependencies are not filtered whatever the value ofincludedOptionalDependencies
since the feature is disabled (what I refer as "backward compatibility reasons")filterOptionalDependencies
set totrue
andincludedOptionalDependencies
are absent, then all the optional dependencies are filtered out.filterOptionalDependencies
set totrue
andincludedOptionalDependencies
are present, then only the optional dependencies inincludedOptionalDependencies
are kept, the rest is filtered out.Is it clear enough now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, thanks. This PR actually enables reasonable use-cases for optional dependencies in Quarkus apps. Otherwise, I am not sure they make sense in Quarkus apps. There is a use-case of re-augmenting mutable-jar packaged apps though. But even then it might benefit from these config options.