Skip to content

CAMEL-23334: Fix lazy plugin loading to skip unnecessary Maven resolution#23003

Merged
Croway merged 1 commit intoapache:mainfrom
Croway:fix/CAMEL-23334-lazy-plugin-loading
May 6, 2026
Merged

CAMEL-23334: Fix lazy plugin loading to skip unnecessary Maven resolution#23003
Croway merged 1 commit intoapache:mainfrom
Croway:fix/CAMEL-23334-lazy-plugin-loading

Conversation

@Croway
Copy link
Copy Markdown
Contributor

@Croway Croway commented May 6, 2026

Summary

  • 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 — 379 tests, 0 failures)
  • E2E: camel version with forage plugin installed produces no resolution messages
  • E2E: camel forage still resolves the forage plugin correctly
  • E2E: camel plugin lists all configured plugins

…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:22
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions github-actions Bot added the dsl label May 6, 2026
@davsclaus
Copy link
Copy Markdown
Contributor

and jbang itself may eventually also become faster, and because camel jbang has a lot of commands and options then this will be good for us as well: jbangdev/jbang#2453

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

🧪 CI tested the following changed modules:

  • dsl/camel-jbang/camel-jbang-core

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • dsl/camel-jbang/camel-jbang-core: 1 test(s) disabled on GitHub Actions

💡 Manual integration tests recommended:

You modified dsl/camel-jbang/camel-jbang-core. The related integration tests in dsl/camel-jbang/camel-jbang-it are excluded from CI. Consider running them manually:

mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
All tested modules (6 modules)
  • Camel :: JBang :: Core
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Launcher :: Container

⚙️ View full build and test results

@Croway
Copy link
Copy Markdown
Contributor Author

Croway commented May 6, 2026

and jbang itself may eventually also become faster, and because camel jbang has a lot of commands and options then this will be good for us as well: jbangdev/jbang#2453

nice!

@Croway Croway merged commit 8412ef6 into apache:main May 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants