Skip to content

[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
Croway:fix/CAMEL-23334-lazy-plugin-loading-4.18.x
May 6, 2026
Merged

[backport camel-4.18.x] CAMEL-23334: Fix lazy plugin loading to skip unnecessary Maven resolution#23004
Croway merged 1 commit intoapache:camel-4.18.xfrom
Croway:fix/CAMEL-23334-lazy-plugin-loading-4.18.x

Conversation

@Croway
Copy link
Copy Markdown
Contributor

@Croway Croway commented May 6, 2026

Summary

Backport of #23003 to camel-4.18.x.

  • Fix 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 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.
  • Add tests for the filtered and unfiltered getActivePlugins overloads.

Before: camel version with a third-party plugin (453 transitive deps) → ~3.7s wasted on Maven resolution
After: camel version → zero Maven resolution, instant

Test plan

  • Unit tests pass (mvn verify in camel-jbang-core on main — 379 tests, 0 failures)
  • E2E: camel version with forage plugin installed produces no resolution messages
  • E2E: camel forage still resolves the forage plugin correctly
  • Cherry-pick applied cleanly, no conflicts

…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.
@Croway Croway requested review from gnodet and oscerd May 6, 2026 11:29
@Croway Croway merged commit 6e86634 into apache:camel-4.18.x May 6, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants