[
https://issues.apache.org/jira/browse/CAMEL-24727?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claus Ibsen resolved CAMEL-24727.
---------------------------------
Resolution: Fixed
Stage 1 is done: camel-jbang-export is the engine of camel export, with a Java
API (ProjectExporter, ExportRequest, ExportContext, DependencyResolver) that
needs neither picocli nor camel-jbang-core, and run and export share one
settings pipeline.
Merged PRs:
* #28671 picocli-free helpers moved to camel-jbang-export
* #28675 ExportRequest / ExportContext / ProjectExporter / the exporters (Java
API)
* #28688 export hygiene: work dir, no logging configuration, no system
properties read by the engine, extra repos
* #28696 golden tests of run and export (RunExportGoldenTest)
* #28726 flaky ExportApiTest fix
* #28728 the run settings pipeline shared by run and export
* #28732 SilentRunDependencyResolver (no picocli, no camel-jbang-core)
* #28735 the export uses it by default; the old silent run through camel run is
removed
* #28737 the export finds the dependencies with its own --profile
* #28738 an exporter holds the ExportRequest instead of extending it; the
exporters are internal
Upgrade guide 4.24: camel-jbang - camel export boots the integration in the
same JVM, no longer through camel run.
Stage 2 (the runner) continues in CAMEL-24726.
_Claude Code on behalf of davsclaus (Claus Ibsen)_
> camel-jbang: stage 1 - extract camel-jbang-export module
> --------------------------------------------------------
>
> Key: CAMEL-24727
> URL: https://issues.apache.org/jira/browse/CAMEL-24727
> Project: Camel
> Issue Type: Sub-task
> Components: camel-jbang
> Reporter: Ricardo Martinez
> Assignee: Claus Ibsen
> Priority: Trivial
> Fix For: 4.24.0
>
>
> h2. Motivation
> The only Java API to export a Camel integration to a Maven project is
> {{camel-jbang-core}}, i.e. the Camel CLI itself. Every consumer therefore
> depends on picocli, jline and ~3500 lines of Run.
> This stage moves the export machinery into a picocli-free library module so
> that consumers like Kaoto and the Camel TUI can create and run exported
> projects through a pure Java API.
> h2. What changes
> New module {{dsl/camel-jbang/camel-jbang-export}} (package
> {{org.apache.camel.dsl.jbang.export}}).
> Dependencies: camel-kamelet-main, camel-tooling-maven, camel-catalog,
> freemarker, plexus-xml, snakeyaml. No picocli, no jline.
> Key relocated / new types:
> || Today (camel-jbang-core) || Moves to camel-jbang-export ||
> | ExportBaseCommand option fields | {{ExportRequest}} — plain mutable config |
> | ExportBaseCommand logic (resolveDependencies, copySourceFiles,
> copyMavenWrapper, ...) | {{Exporter}} abstract class, same protected hook
> names |
> | ExportCamelMain, ExportQuarkus, ExportSpringBoot (package-private) |
> {{CamelMainExporter}}, {{QuarkusExporter}}, {{SpringBootExporter}} (public) |
> | Export.doExport() runtime switch | {{ProjectExporter}} facade: {{int
> export(ExportRequest)}} |
> | ExportBaseCommand.runSilently(), Run exportRun branch, RunDownloadListener,
> writeSettings | {{SilentRun}} + {{RunSettings}} |
> | ExportHelper, RunHelper pom half, TemplateHelper, VersionHelper,
> QuarkusHelper, RuntimeUtil, PathUtils, XmlHelper, and others | move as-is
> (already picocli-free) |
> | RuntimeType, CamelJBangConstants, PluginExporter, Printer, Source,
> SourceScheme, SourceHelper | move; consumers rewrite imports |
> | pom.ftl templates, Dockerfiles, readme templates, run-java.sh,
> maven-wrapper/, camel-wrapper/ | move |
> {{Export}} and {{ExportBaseCommand}} stay in {{camel-jbang-core}} as picocli
> delegates until stage 6. {{camel-jbang-runner}} dependency flips from
> {{camel-jbang-core}} to {{camel-jbang-export}}.
> {{Run}} loses the exportRun branch, RunDownloadListener, writeSettings and
> the bodies of the three run<Runtime> methods (~700 lines); they become calls
> to ProjectExporter and ProjectRunner.
> Add the module to {{dsl/camel-jbang/pom.xml}}, {{bom/camel-bom}} and the
> camel-package-maven-plugin config. Move export-related tests (ExportTest,
> ExportHelperTest, RuntimeTypeTest) to the new module.
> h2. Compatibility
> * Package change for RuntimeType, Printer, PluginExporter,
> CamelJBangConstants, SourceScheme, ExportHelper — in-tree consumers rewrite
> imports in the same PR; out-of-tree camel-jbang plugins need the same import
> rewrite. Document in the 4.x upgrade guide.
> * {{.camel-jbang/camel-jbang-run.properties}} path and keys are preserved.
> * No CLI option added, removed or renamed.
> h2. Note
> After this stage a consumer of {{camel-jbang-export}} or
> {{camel-jbang-runner}} no longer carries picocli or jline. camel-kamelet-main
> is still a mandatory compile dependency of
> {{camel-jbang-export}} (resolved in stage 7).
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)