davsclaus opened a new pull request, #26226:
URL: https://github.com/apache/camel/pull/26226

   Fixes https://issues.apache.org/jira/browse/CAMEL-24659
   
   ## Motivation
   
   `camel run` runs the integration in-process inside the Camel CLI (jbang) 
JVM. That is great for prototyping, but the JVM classpath also contains 
camel-jbang-core and all its dependencies, so it does not look like a 
production deployment. `--runtime=spring-boot` and `--runtime=quarkus` already 
export to a temporary project and run via Maven in a clean JVM, and the TUI 
needs the same for Camel Main so what it observes matches what the user ships.
   
   ## Changes
   
   - **`camel run` defaults to a new `jbang` runtime**, which is the existing 
in-process behaviour. `RuntimeType` gains `jbang` and `exportRuntime()` (jbang 
exports as main). The shared `RuntimeTypeConverter` used by `camel export`, 
`camel dependency`, `camel version`, `camel update` and the kubernetes plugin 
treats `jbang` as an alias for `main`; `Run` uses its own converter and 
completion candidates.
   - **`--runtime=main` now runs in a separate JVM**: the sources are exported 
with `ExportCamelMain` to `.camel-jbang-run/<ts>`, packaged with the Maven 
wrapper, and the runner JAR is started with plain `java`. `camel:run` was not 
used because the camel-maven-plugin runs the main class inside the Maven JVM 
without forking. Supported: `--dev` (routes reload from the original source 
directory), `--source-dir`, `--jvm-args`, `--jvm-debug`, `--jfr`, `--profile`, 
`--camel-version` and the max duration options. In-process-only options 
(`--background`, `--code`, `--open-api`, `--empty`, `--mcp-stdio`) are rejected 
with a hint to use `--runtime=jbang`. An existing `pom.xml` still runs via `mvn 
camel:run`, and runtime detection from the pom only applies under `jbang`.
   - Logs go to `~/.camel/<name>.log` using the `camel.main.name` of the 
exported project, which `camel log` and the TUI Log tab already fall back to.
   - **TUI**: the F2 run options form always passes `--runtime=` (so Camel Main 
launches use the clean JVM) and offers JBang as a fourth choice when the 
runtime is not locked to a Maven project.
   - Docs: runtimes section in the running guide, 4.23 upgrade guide entry, TUI 
guide, regenerated command metadata.
   
   ## Testing
   
   - New `RuntimeTypeTest`; runtime option cases in `RunTest` and `ExportTest`; 
`DependencyListTest`, `DependencyUpdateTest` switch and TUI 
`RunOptionsFormTest` updated/passing.
   - Manually verified with the 4.23.0-SNAPSHOT CLI: `camel run --runtime=main 
hello.camel.yaml` starts a separate `java -jar` process visible in `camel ps`, 
writes the log file, `--dev` picks up a saved edit within seconds, 
`--max-seconds` stops the JVM, and the temp project and log are removed on exit.
   
   Follow-ups not in this PR: the Spring Boot and Quarkus runs ignore the max 
duration options in the same way, and the Quarkus run names its log after the 
export name rather than `camel.main.name`.
   
   _Claude Code on behalf of davsclaus_
   
   🤖 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]

Reply via email to