smongiar opened a new pull request, #27206:
URL: https://github.com/apache/camel/pull/27206
## Summary
- `ExportBaseCommand.resolveDependencies()`: add a defensive fallback that
reads `spec.dependencies` from every official kamelet used in the integration
and includes them in the export dependency set.
- `KameletCatalogHelper`: add `findKameletDependencies()` — loads the
catalog once and returns `Map<name, deps>`, reusing the same download as
`findKameletNames`.
- `known-third-party-libraries.properties`: add
`com.fasterxml.jackson.annotation → jackson-annotations` mapping.
## Root cause
`camel export` captures kamelet-declared dependencies through a download
listener that fires during the silent run. This mechanism requires the full
chain: Java route builder compiles → kamelet endpoint resolves → template loads
→ `DependencyDownloaderKamelet` fires → listener writes `dependency=` to
settings. If the Java route builder fails to compile (e.g., `jackson-databind`
not yet on the classpath) before the kamelet is reached, its
`spec.dependencies` are never written and are absent from the exported
`pom.xml`.
The JSON kamelet (`json-deserialize-action`) declares `camel:jackson` in
`spec.dependencies`, but the test's route builder imports `ObjectMapper` and
`@JsonProperty` directly. The compilation fails because Jackson is not
pre-downloaded, which in turn prevents the kamelet from loading and recording
its own `camel:jackson` dependency — a circular bootstrap problem.
## Fixes
**1. Fallback in `resolveDependencies()`** — after the main settings loop,
iterate over `kamelet=` entries and add their `spec.dependencies` from the
pre-loaded catalog map. This guarantees the dependency is present even when the
silent-run chain breaks.
**2. `known-third-party-libraries.properties`** — adds
`com.fasterxml.jackson.annotation =
com.fasterxml.jackson.core:jackson-annotations:${jackson2-version}` so
`JavaKnownImportsDownloader` pre-downloads `jackson-annotations` when a route
builder imports `@JsonProperty`, matching the existing `jackson-databind` entry.
## Test plan
- [ ] Existing `camel export` tests pass
- [ ] A kamelet integration that uses a Java route builder with direct
Jackson imports exports correctly without `--dep jackson`
- [ ] `camel export` for `json-deserialize-action` / `json-serialize-action`
kamelets succeeds
🤖 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]