This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch CAMEL-26901-batch in repository https://gitbox.apache.org/repos/asf/camel.git
commit 29e5e35c14ff64be08800ae24d7929ab56659369 Merge: e41fb0ebe1df 900e391186f7 Author: Claus Ibsen <[email protected]> AuthorDate: Thu Nov 12 22:56:27 2026 +0100 Merge branch 'CAMEL-26901-run-deps' into CAMEL-26901-batch # Conflicts: # docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc .../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc | 11 +++ .../CliExecutionExceptionHandler.java | 17 ++++- .../jbang/core/commands/ExitCodeContractTest.java | 26 +++++++ .../java/org/apache/camel/main/KameletMain.java | 9 ++- .../download/CommandLineDependencyDownloader.java | 16 ++++- .../camel/main/download/DependencyDownloader.java | 11 +++ .../download/DependencyDownloaderStrategy.java | 20 +++++- .../camel/main/download/DownloadThreadPool.java | 39 ++++++++++- .../main/download/MavenDependencyDownloader.java | 18 ++++- .../CommandLineDependencyDownloaderTest.java | 45 ++++++++++++ ....java => DependencyDownloaderStrategyTest.java} | 60 ++++++++-------- .../main/download/DownloadThreadPoolTest.java | 80 ++++++++++++++++++++++ .../camel/tooling/maven/MavenDownloaderImpl.java | 6 +- .../tooling/maven/MavenDownloaderImplTest.java | 16 +++++ 14 files changed, 334 insertions(+), 40 deletions(-) diff --cc docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc index c220e9a0b35c,0fe0f39cc0c4..5b5aadf1caf3 --- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc +++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc @@@ -8394,10 -8381,13 +8394,21 @@@ Before, with `cacheScript=true` it coul ran it too. The header is now removed after use, so a later language endpoint in the route runs its own script instead of the header's. Set the header again before each language endpoint that should use it. +=== camel-jbang - camel run loads one version of each library + +`camel run` downloads the JARs of each component when it is first used. A library that is already loaded is now used, +in the version that was loaded first, for the components that are loaded later, as the `dependencyManagement` of a +Maven project would. Before, a later component that depended on another version of the library added that version as +well, so the classpath could hold, for example, three versions of Netty, and a class was loaded from whichever JAR +came first. Use `--verbose` to see the JARs added for each dependency. ++ + === camel-jbang - camel run stops when a dependency it was given cannot be downloaded + + `camel run` now stops with exit code 1 when a dependency given with `--dep`, `camel.jbang.dependencies`, a `//DEPS` + line or the dependencies of a Kamelet cannot be downloaded, and prints why on one line, such as + `ERROR: Cannot download dependency: com.acme:foo:1.0 due to: ... Could not find artifact com.acme:foo:jar:1.0 in central (...)`. + Before, it logged the error with the stack trace, started the routes without the dependency, and exited with 0. + In dev mode (`--dev`), a reload with a `//DEPS` line that cannot be downloaded fails, and the routes keep running as + they were. Other commands of the Camel CLI that fail to download a dependency also exit with 1 and print one line, + instead of exiting with 70 and printing the stack trace (use `--verbose` for the stack trace). `camel export` still + writes the dependency to the exported project.
