[backport camel-4.18.x] CAMEL-23334: Fix lazy plugin loading to skip unnecessary Maven resolution#23004
Merged
Croway merged 1 commit intoapache:camel-4.18.xfrom May 6, 2026
Conversation
…tion PluginHelper.addPlugins() was downloading ALL configured plugins before filtering by the target command. This caused expensive Maven resolution (e.g. 3.7s for 453 transitive dependencies) on every CLI invocation, even for commands like "camel version" that don't use any plugin. Move the command-name filter into getActivePlugins() so it runs before getPlugin()/downloadPlugin(), skipping resolution entirely for plugins that don't match the current command.
oscerd
approved these changes
May 6, 2026
davsclaus
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Backport of #23003 to
camel-4.18.x.PluginHelper.addPlugins()which was downloading ALL configured plugins before filtering by the target command, causing expensive Maven resolution on every CLI invocation — even for commands likecamel versionthat don't use any plugin.getActivePlugins()so it runs beforegetPlugin()/downloadPlugin(), skipping resolution entirely for plugins that don't match the current command.getActivePluginsoverloads.Before:
camel versionwith a third-party plugin (453 transitive deps) → ~3.7s wasted on Maven resolutionAfter:
camel version→ zero Maven resolution, instantTest plan
mvn verifyincamel-jbang-coreon main — 379 tests, 0 failures)camel versionwith forage plugin installed produces no resolution messagescamel foragestill resolves the forage plugin correctly