davsclaus opened a new pull request, #28735: URL: https://github.com/apache/camel/pull/28735
_Claude Code on behalf of davsclaus_ Stage 1c-4 of [CAMEL-24727](https://issues.apache.org/jira/browse/CAMEL-24727), after #28732 (1c-3) added `SilentRunDependencyResolver` next to the old silent run. `camel export` and the Java API of camel-jbang-export now find the dependencies with `SilentRunDependencyResolver`, the resolver of camel-jbang-export, which needs neither picocli nor camel-jbang-core. The old silent run through `camel run` is removed. ## Changes - **The default resolver.** `ExportContext` uses `SilentRunDependencyResolver` unless another `DependencyResolver` is set. The `ServiceLoader` lookup, `RunDependencyResolver` and its service file in camel-jbang-core are removed, so the Java API no longer needs camel-jbang-core on the classpath. - **`Run` has no export mode any more.** `Run.runExport()`, the `exportRun` field and its branches in `Run` and `Debug` are removed. `camel run` itself is unchanged: these branches only applied to the silent run of an export. - **A YAML route that did not load is reported as before.** `camel run` and the old silent run log what `camel validate yaml` says before the loader's error (CAMEL-24851). `ExportContext.withStartFailureListener` is called when the silent run fails to start, and `camel export` sets it to `YamlLoadFailureReport`, so the export keeps the report. `YamlLoadFailureReport` stays in camel-jbang-core: it uses `SourceValidator` and the YAML DSL validator (with its JSON schema dependency), which camel-jbang-export does not have. A tool that uses the Java API can set its own listener. - **What no longer applies to an export**, as it only says how `camel run` starts (the new resolver already behaved like this in #28732): - `camel.jbang.background` and `camel.jbang.jvmDebug` in `application.properties`. The old silent run started a separate `camel run` process for them, which kept running after the export (background) or which the export waited for (debug), and the dependencies of the routes were not recorded. - `--camel-version` from `camel-launcher`: it sets the Camel version of the exported project, and the export no longer fails with the usage error of `camel run`. - A missing `clipboard*` file: the export no longer reads it from the clipboard, and fails with exit code 3 (file not found), as for any other missing file. - **Docs.** "Exporting from Java" says that camel-jbang-export needs neither camel-jbang-core nor picocli. The tips page says that the clipboard is for `camel run` only. The upgrade guide lists the three changes above. ## Tests - `RunExportGoldenTest`: the 15 export cases give the same output as before, with no change to the expected files (#28732 compared both resolvers on them). A new export case, `run-settings`, has an `application.properties` with `camel.jbang.background=true` and `camel.jbang.jvmDebug=5005`, and `exportIgnoresHowCamelRunStarts` checks that the export gives the same output with and without these two settings. - `ExportApiTest.aYamlRouteThatDoesNotLoadIsReportedAsCamelRunDoes`: an export with the context of the CLI logs the report of the YAML validator. - `SilentRunDependencyResolverTest`: the default resolver of `ExportContext`, the start failure listener, and a missing `clipboard.yaml` (exit code 3). - camel-jbang-export: 127 tests pass. - camel-jbang-core: 2497 tests in the default fork and 285 in the serial fork. The only failures, `EvalSimpleTest` (it runs the Camel installed with JBang) and 9 tests of the AI tools, fail on `main` locally too. - The plugins and the launcher compile. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
