Salvatore Mongiardo created CAMEL-25239:
-------------------------------------------

             Summary: 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


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)

Reply via email to