[
https://issues.apache.org/jira/browse/CAMEL-25239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18121964#comment-18121964
]
Claus Ibsen commented on CAMEL-25239:
-------------------------------------
Fix: https://github.com/apache/camel/pull/27283 (supersedes PR 27206).
The root cause in the reproducers was an import of a Camel component class
other than the component class itself (AWS2S3Constants for the aws-s3-source
Kamelet). The known imports now also find a component by its package, so the
source compiles, the Kamelet loads and its spec.dependencies are recorded as
before. Verified with camel export on Camel Main, Spring Boot and Quarkus. A
library that is neither known nor a component is still declared with --dep.
4.23 only, no backport.
_Claude Code on behalf of davsclaus_
> camel export: kamelet spec.dependencies missing from pom.xml when Java route
> builder fails to compile during silent run
> -----------------------------------------------------------------------------------------------------------------------
>
> Key: CAMEL-25239
> URL: https://issues.apache.org/jira/browse/CAMEL-25239
> Project: Camel
> Issue Type: Bug
> Reporter: Salvatore Mongiardo
> Assignee: Claus Ibsen
> Priority: Major
>
> When {{camel export}} is used with an integration that combines a Java route
> builder and a kamelet (e.g. {{json-deserialize-action}}), the exported
> {{pom.xml}} can be missing the kamelet's declared {{spec.dependencies}} (e.g.
> {{camel:jackson}}).
> *Root cause:*
> {{camel export}} captures kamelet-declared dependencies through a download
> listener that fires during a silent run. The chain is:
> # Java route builder compiles
> # Kamelet endpoint resolves
> # Kamelet template loads
> # {{DependencyDownloaderKamelet}} fires
> # Listener writes {{dependency=}} to the settings file
> If the Java route builder imports a class (e.g. {{ObjectMapper}},
> {{@JsonProperty}}) whose JAR is not yet on the classpath, compilation fails
> before the kamelet is reached. Neither the {{kamelet=}} nor the
> {{dependency=}} lines are written to the settings file, so
> {{spec.dependencies}} are absent from the exported {{pom.xml}}.
> This is a circular bootstrap problem: the missing dependency (e.g.
> {{jackson-databind}}) is the one the kamelet would have provided, but the
> kamelet never loads because the route builder that uses it cannot compile
> first.
> *Impact:*
> - Exported projects fail to build / run out of the box.
> - Affects any integration where a Java route builder has direct imports of
> classes provided by a kamelet dependency, and the export's silent run fails
> at compilation rather than at kamelet resolution.
> *Expected behaviour:*
> {{camel export}} should include all {{spec.dependencies}} declared by every
> kamelet referenced in the integration in the exported {{pom.xml}}, regardless
> of whether the silent-run download chain completes successfully.
> *Related PR:* https://github.com/apache/camel/pull/27206
--
This message was sent by Atlassian Jira
(v8.20.10#820010)