Claus Ibsen created CAMEL-27476:
-----------------------------------
Summary: camel-jbang - camel run --kamelets-version does not win
over the camel-kamelets jar of the launcher
Key: CAMEL-27476
URL: https://issues.apache.org/jira/browse/CAMEL-27476
Project: Camel
Issue Type: Bug
Components: camel-jbang
Reporter: Claus Ibsen
Fix For: 4.24.0
The launcher (CamelJBang.java, dist and src/main/jbang) has
{noformat}//DEPS
org.apache.camel.kamelets:camel-kamelets:${camel-kamelets.version:4.22.0}{noformat}
so that jar is on the launcher classpath.
{{camel run --kamelets-version=X}} downloads camel-kamelets X at runtime
(KnownKameletRoutesBuilderLoader / DependencyDownloaderKamelet), but the
{{kamelets/<name>.kamelet.yaml}} resources from the launcher jar are found
first. So a Kamelet that exists in both versions is loaded from the launcher's
version; only Kamelets new in X come from X.
Seen with {{--kamelets-version=4.24.0-SNAPSHOT}}: the 4.22 postgresql-sink (no
dataTypes) was used, and the route failed with "Cannot unmarshal using jackson:
the body is a Map".
Workarounds today:
* foreground: {{jbang -Dcamel-kamelets.version=X camel@apache/camel run ...}}
works
* {{--background}}: does not work, the child process is started without the -D,
so its launcher has the default version again
Expected: the version asked for with --kamelets-version (or
camel.jbang.kameletsVersion) is the one whose Kamelets are used, in the
foreground and in a background run.
Not part of this ticket: bumping the launcher default and
camel-kamelets-catalog-version in parent/pom.xml. That goes with the move of
Kamelets into Camel in 4.25.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)