davsclaus opened a new pull request, #28671: URL: https://github.com/apache/camel/pull/28671
## Description [CAMEL-24727](https://issues.apache.org/jira/browse/CAMEL-24727) (stage 1 of [CAMEL-24724](https://issues.apache.org/jira/browse/CAMEL-24724)) This is the first of two PRs for stage 1. It adds the new module `dsl/camel-jbang/camel-jbang-export` and moves into it the helpers that `camel export` uses and that need no picocli or jline. The goal of CAMEL-24724 is a Java API for export and run, so tools like Kaoto do not have to spawn the `camel` binary. This PR is the mechanical part: classes move and imports change, and no behaviour changes. The second PR adds the API (`ExportRequest`, `Exporter`, `ProjectExporter`). It also takes the silent run that export uses to find the dependencies out of `Run`, and moves the templates and resources together with the code that reads them. **What moves** - `org.apache.camel.dsl.jbang.export.common`: `RuntimeType` and `HawtioVersion` (with the templating plugin), `CamelJBangConstants`, `Printer`, `StringPrinter`, `PluginExporter`, `Source`, `SourceScheme`, `SourceHelper`, `VersionHelper`, `RuntimeUtil`, `TemplateHelper`, `PathUtils`, `CatalogLoader`, `XmlHelper`, `GenAiDependencyHelper`, `QuarkusHelper`, `PropertyResolver`, `CompressionHelper`, `GistHelper`, `GitHubHelper` and `ExportHelper`. - `org.apache.camel.dsl.jbang.export.catalog`: `KameletCatalogHelper` and its three model classes. - Their tests move along, except the ones that need the test resources or templates of camel-jbang-core. **Changes needed to make the move possible** - `CamelHome` (new) holds the home directory and the `.camel` / `.camel-jbang` names. `CommandLineHelper` delegates to it, so its API stays the same. - `CamelAndRuntimeVersions` was a record nested in the `VersionList` command. It is now a record of its own, and `VersionList` maps it to its rows itself. - `XmlHelper.colorPrint` used jansi and had one caller, so it moved to `CamelCommandHelper`. - `KameletCatalogHelper` used the class loader of the `CatalogKamelet` command. It now uses its own class loader, which is the same one. - `RuntimeUtil.LOG_DIR` is public now, because `LogConfigurationTest` in camel-jbang-core uses it. **Build and CI** - The new module is added to `dsl/camel-jbang/pom.xml`, `parent/pom.xml` and `bom/camel-bom`, and camel-jbang-core depends on it. - The regenerated command metadata of camel-jbang-core and of the generate, kubernetes and validate plugins differs only in the package of `RuntimeType`. - The two native launcher workflows resolve the in-repo modules from Apache Snapshots, where camel-jbang-export does not exist yet. They now build camel-jbang-export together with camel-jbang-core. There is no upgrade-guide entry: no code outside this repository uses these classes. **Tests** I ran the tests of every module this PR touches: export 83, core 2430, TUI 2283, MCP 505, kubernetes 156, launcher 292 (36 skipped), validate 23, and the generate, mcp and test plugins. They all pass, along with `PrepareCamelJBangCommandsMojoTest`. I did not run the camel-jbang-it integration tests. _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]
