Skip to content

[camel-4.18.x] Fix camel export to auto-detect kamelets version from classpath#23783

Open
smongiar wants to merge 1 commit into
apache:camel-4.18.xfrom
smongiar:fix/export-kamelets-version-4.18.x
Open

[camel-4.18.x] Fix camel export to auto-detect kamelets version from classpath#23783
smongiar wants to merge 1 commit into
apache:camel-4.18.xfrom
smongiar:fix/export-kamelets-version-4.18.x

Conversation

@smongiar
Copy link
Copy Markdown
Contributor

@smongiar smongiar commented Jun 5, 2026

Cherry-pick of #23781 to camel-4.18.x.

Summary

  • The --kamelets-version option in camel export was hardcoded to a compile-time default from parent/pom.xml
  • VersionHelper.extractKameletsVersion() can detect the actual version from the classpath, but was never called because the field was always pre-initialized
  • Remove the compile-time default so extractKameletsVersion() runs at runtime
  • Add null-check in runSilently() which runs before resolveDependencies()

@smongiar smongiar force-pushed the fix/export-kamelets-version-4.18.x branch from f875639 to 8ff8e94 Compare June 5, 2026 09:53
@smongiar smongiar force-pushed the fix/export-kamelets-version-4.18.x branch 2 times, most recently from 50204de to 194dd89 Compare June 5, 2026 15:45
The --kamelets-version option was hardcoded to a compile-time default
from parent/pom.xml in ExportBaseCommand, CatalogKamelet, CatalogDoc,
and KameletTools. When the actual kamelets jar on the classpath has a
different version (e.g. in productized builds), wrong version is used.

Remove the compile-time defaults and let VersionHelper.extractKameletsVersion()
detect the actual version from the classpath at runtime, falling back to the
compiled-in default only when no kamelets jar is found.
@smongiar smongiar force-pushed the fix/export-kamelets-version-4.18.x branch from 194dd89 to 64efc53 Compare June 5, 2026 16:13
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.

2 participants