You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "smongiar (via GitHub)" <gi...@apache.org> on 2026/10/01 13:16:46 UTC

[PR] CAMEL-25094: camel export: guarantee kamelet spec.dependencies in pom.xml + add jackson-annotations known import [camel]

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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25094: camel export: guarantee kamelet spec.dependencies in pom.xml + add jackson-annotations known import [camel]

Posted by "gnodet-bot (via GitHub)" <gi...@apache.org>.
gnodet-bot commented on code in PR #27206:
URL: https://github.com/apache/camel/pull/27206#discussion_r4155835882


##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/catalog/KameletCatalogHelper.java:
##########
@@ -38,6 +38,23 @@ public static List<String> findKameletNames(String version, String repositories)
         return new ArrayList<>(kamelets.keySet());
     }
 
+    /**
+     * Returns a map of kamelet name → spec.dependencies for all official kamelets in the catalog. Loaded in a single
+     * pass to avoid repeated catalog downloads.
+     */
+    public static Map<String, List<String>> findKameletDependencies(String version, String repositories)
+            throws Exception {
+        Map<String, Object> kamelets = loadKamelets(version, repositories);
+        Map<String, List<String>> result = new LinkedHashMap<>();
+        for (Map.Entry<String, Object> entry : kamelets.entrySet()) {
+            List<String> deps = getDependencies(entry.getValue());
+            if (deps != null && !deps.isEmpty()) {
+                result.put(entry.getKey(), deps);
+            }
+        }

Review Comment:
   ⚠️ **Subtle behavior change:** `findKameletDependencies()` only includes kamelets that have non-empty `spec.dependencies` (line 51: `if (deps != null && !deps.isEmpty())`). When `ExportBaseCommand` derives `officialKamelets` from `officialKameletDeps.keySet()`, any official kamelet with zero declared dependencies would be excluded from the list.
   
   Currently all official kamelets declare at least `camel:kamelet`, so this isn't a production bug *today*. But the contract has silently changed — `findKameletNames()` returned **all** catalog entries, while `findKameletDependencies().keySet()` returns only a subset. If a kamelet without dependencies is ever added to the catalog, it won't be recognized as "official" and the `asfKamelets` flag won't be set, breaking the kamelets BOM inclusion.
   
   Two options:
   
   **Option A** — Include all kamelets in the map (with `List.of()` for those without deps):
   ```suggestion
       public static Map<String, List<String>> findKameletDependencies(String version, String repositories)
               throws Exception {
           Map<String, Object> kamelets = loadKamelets(version, repositories);
           Map<String, List<String>> result = new LinkedHashMap<>();
           for (Map.Entry<String, Object> entry : kamelets.entrySet()) {
               List<String> deps = getDependencies(entry.getValue());
               result.put(entry.getKey(), deps != null ? deps : List.of());
           }
           return result;
       }
   ```
   
   **Option B** — Keep calling `findKameletNames()` for the official list and use `findKameletDependencies()` only for the fallback lookup.



##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java:
##########
@@ -659,8 +659,12 @@ protected Set<String> resolveDependencies(Path settings, Path profile) throws Ex
 
         List<String> lines = RuntimeUtil.loadPropertiesLines(settings);
 
-        // check if we use custom and/or official ASF kamelets
-        List<String> officialKamelets = KameletCatalogHelper.findKameletNames(kameletsVersion, mavenResolver.repos());
+        // check if we use custom and/or official ASF kamelets; also pre-load their spec.dependencies
+        // so they can be added as a fallback when the runSilently mechanism misses them (e.g. when
+        // Java route compilation fails before the kamelet is loaded and its deps are recorded)
+        Map<String, List<String>> officialKameletDeps
+                = KameletCatalogHelper.findKameletDependencies(kameletsVersion, mavenResolver.repos());
+        List<String> officialKamelets = new ArrayList<>(officialKameletDeps.keySet());

Review Comment:
   💡 This derives the official kamelet list from `officialKameletDeps.keySet()`, which — per the comment above on `findKameletDependencies` — may miss kamelets with empty `spec.dependencies`. See suggestion on `KameletCatalogHelper.java`.



##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java:
##########
@@ -781,6 +785,25 @@ protected Set<String> resolveDependencies(Path settings, Path profile) throws Ex
             }
         }
 
+        // Defensive fallback: add spec.dependencies from official kamelets used in this integration.
+        // The primary mechanism (runSilently download listener) only captures kamelet-declared
+        // dependencies when the kamelet is loaded during the silent run. If a Java route builder
+        // fails to compile (e.g., missing jackson-databind) before the kamelet is reached, its
+        // spec.dependencies are never written to settings, causing them to be absent in the
+        // exported pom.xml. This fallback guarantees they are always included.
+        for (String line : lines) {
+            if (line.startsWith("kamelet=")) {
+                String kameletName = StringHelper.after(line, "kamelet=");
+                List<String> kameletDeps = officialKameletDeps.getOrDefault(kameletName, List.of());
+                for (String dep : kameletDeps) {
+                    // skip the kamelets BOM itself — it is already handled above
+                    if (!dep.contains("org.apache.camel.kamelets:camel-kamelets")) {
+                        answer.add(dep);
+                    }
+                }
+            }
+        }
+

Review Comment:
   💡 The fallback logic is correct: iterating `kamelet=` entries, looking up their deps in the pre-loaded map, and filtering out the kamelets BOM. Since `answer` is a `TreeSet`, duplicate additions (e.g. `camel:kamelet` already present from the primary mechanism) are harmless.
   
   One minor observation: this second loop over `lines` could be folded into the existing loop above (lines 671–783) where `kamelet=` entries are already being scanned, avoiding the duplicate iteration. Not a correctness issue, but a readability improvement.



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25239: camel-jbang: resolve known imports before kamelet loading [camel]

Posted by "smongiar (via GitHub)" <gi...@apache.org>.
smongiar commented on PR #27206:
URL: https://github.com/apache/camel/pull/27206#issuecomment-5951054084

   Answering davsclaus's two open questions:
   
   **1. Is the narrow scope (jackson-annotations mapping only) intentional?**
   
   Yes. The root-cause fix is gnodet's commit — resolving known imports *before* kamelet loading so the Java route builder can compile with `@JsonProperty` present. The `jackson-annotations` properties entry is a complementary, defence-in-depth addition: it ensures that if the resolution ordering changes again, or if a user runs `camel export` in an environment where `jackson-annotations` isn't pulled in transitively (e.g., different runtime configurations, stripped BOM, etc.), the known-import downloader still covers it.
   
   The JIRA title ("camel export: kamelet spec.dependencies missing from pom.xml when Java route builder fails to compile during silent run") is broader than just the mapping — it captures the whole scenario. I'd suggest keeping it as-is and letting gnodet's fix carry the description, with our mapping as a supplementary entry. A follow-up JIRA for the general circular-bootstrap case is a reasonable idea if needed.
   
   **2. Does the test actually fail on `main` without the new properties line?**
   
   Checking `camel-kamelet-main/pom.xml`:
   ```xml
   <dependency>
       <groupId>org.apache.camel</groupId>
       <artifactId>camel-jackson</artifactId>   <!-- compile scope, no <scope> element -->
   </dependency>
   ```
   
   `camel-jackson` transitively brings `jackson-databind` → `jackson-annotations`, so **jackson-annotations IS already on the test classpath**. The in-process export run therefore has access to `@JsonProperty` regardless of our properties entry, meaning the test **probably does pass on `main` without our line**.
   
   The test validates gnodet's fix (the import resolution timing/ordering change), not our `jackson-annotations` mapping specifically. I don't see a straightforward way to unit-test the mapping without running `camel export` in a fully isolated subprocess with a clean Maven repo. Happy to drop our properties entry if the consensus is it isn't needed — but it seems harmless and useful as a forward-compatibility measure. Let me know how you'd like to proceed.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25239: camel-jbang: resolve known imports before kamelet loading [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #27206:
URL: https://github.com/apache/camel/pull/27206#discussion_r4165742137


##########
dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ExportTest.java:
##########
@@ -393,6 +394,30 @@ public void shouldExportOfficialKamelet(RuntimeType rt) throws Exception {
         Assertions.assertTrue(f.exists());
     }
 
+    @ParameterizedTest
+    @MethodSource("runtimeProvider")
+    public void shouldExportKameletUsedByJavaRouteWithKnownImport(RuntimeType rt) throws Exception {

Review Comment:
   This test passes on `main` without the change: jackson-annotations is always on the export's classpath through `camel-kamelet-main` → `camel-jackson`. I ran it from this PR's head against a `camel-kamelet-main` jar without the new mapping, and all three runtimes passed. A test that fails on `main` needs a route whose import is *only* provided by the kamelet's dependency. For example:
   
   ```java
   import org.apache.camel.component.aws2.s3.AWS2S3Constants;
   
   public class S3KameletRoute extends org.apache.camel.builder.RouteBuilder {
       @Override
       public void configure() {
           from("kamelet:aws-s3-source?bucketNameOrArn=mybucket&region=eu-west-1&accessKey=x&secretKey=y")
               .log("${header." + AWS2S3Constants.KEY + "}");
       }
   }
   ```
   
   On `main`, `camel export` of this fails with `package org.apache.camel.component.aws2.s3 does not exist`.



##########
dsl/camel-kamelet-main/src/main/known-third-party-libraries.properties:
##########
@@ -140,6 +140,7 @@ com.twilio = com.twilio.sdk:twilio:${twilio-version}
 com.stripe = com.stripe:stripe-java:${stripe-java-version}
 
 # Data: JSON, YAML, CSV, XML, binary formats and transformations
+com.fasterxml.jackson.annotation = com.fasterxml.jackson.core:jackson-annotations:${jackson2-annotations-version}

Review Comment:
   The mapping is correct (and the version property is right). To guard it, a single line in `KnownDependenciesResolverTest#theShippedMappingResolvesThirdPartyClassesByPackage` fails without it, which is how the curated list is tested (CAMEL-24809):
   
   ```java
   assertGav(resolver, "com.fasterxml.jackson.annotation.JsonProperty", "com.fasterxml.jackson.core", "jackson-annotations");
   ```



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25239: camel-jbang: resolve known imports before kamelet loading [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #27206:
URL: https://github.com/apache/camel/pull/27206#discussion_r4163318065


##########
dsl/camel-jbang/camel-jbang-core/src/test/resources/JacksonKameletRoute.java:
##########
@@ -0,0 +1,30 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class JacksonKameletRoute extends org.apache.camel.builder.RouteBuilder {
+
+    @JsonProperty("name")
+    private String name;
+
+    @Override
+    public void configure() {
+        from("kamelet:timer-source")

Review Comment:
   CI fails here on both JDKs: `timer-source` has `message` as a required property, so creating the route from the template is vetoed during the export's silent run (`VetoCamelContextStartException: Failure creating route from template: timer-source`). Passing the parameter should fix it:
   ```suggestion
           from("kamelet:timer-source?message=Hello")
   ```



##########
dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/ExportBaseCommand.java:
##########
@@ -669,7 +669,6 @@ protected Set<String> resolveDependencies(Path settings, Path profile) throws Ex
                 String name = StringHelper.after(line, "kamelet=");
                 if (officialKamelets.contains(name)) {
                     asfKamelets = true;

Review Comment:
   With the fallback removed, this `break` removal isn't needed anymore. Once `asfKamelets` is true, `kamelets` is already true and the loop has nothing else to detect, so it just keeps scanning. Could you restore the `break` so the PR only touches the known-imports mapping and the test?



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25094: camel export: guarantee kamelet spec.dependencies in pom.xml + add jackson-annotations known import [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27206:
URL: https://github.com/apache/camel/pull/27206#issuecomment-5932861728

   <!-- ci-tested-modules -->
   :test_tube: **CI tested the following changed modules:**
   
   - `dsl/camel-jbang/camel-jbang-core`
   - `dsl/camel-kamelet-main`
   
   ---
   
   <details><summary>:microscope: Scalpel shadow comparison — Scalpel: 6 of 697 tested, 8 compile-only — current: 6 all tested</summary>
   
   [Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **6 affected modules** (current approach: 6).
   
   **Skip-tests mode would test 6 modules** (2 direct + 6 downstream), **skip tests for 8** (generated code, meta-modules)
   
   <details><summary>Modules Scalpel would test (6)</summary>
   
   - `camel-jbang-mcp` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-mcp` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-route-parser` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-tui` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-jbang-plugin-validate` ← downstream of org.apache.camel:camel-jbang-core
   - `camel-launcher-container` ← downstream of org.apache.camel:camel-launcher
   
   </details>
   
   <details><summary>Modules with tests skipped (8)</summary>
   
   - `camel-jbang-it`
   - `camel-jbang-main`
   - `camel-jbang-plugin-edit`
   - `camel-jbang-plugin-generate`
   - `camel-jbang-plugin-kubernetes`
   - `camel-jbang-plugin-test`
   - `camel-launcher`
   - `coverage`
   
   </details>
   
   > :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
   
   </details>
   
   :warning: **Some tests are disabled on GitHub Actions** (`@DisabledIfSystemProperty(named = "ci.env.name")`) and require manual verification:
   
   - `dsl/camel-jbang/camel-jbang-core`: 2 test(s) disabled on GitHub Actions
   
   :bulb: **Manual integration tests recommended:**
   
   > You modified `dsl/camel-jbang/camel-jbang-core`. The related integration tests in `dsl/camel-jbang/camel-jbang-it` are excluded from CI. Consider running them manually:
   > ```
   > mvn verify -f dsl/camel-jbang/camel-jbang-it -Djbang-it-test
   > ```
   
   <details><summary>All tested modules (16 modules, 2m 53s total)</summary>
   
   **Total reactor time:** 2m 53s
   
   | Module | Duration | Status |
   | --- | --- | --- |
   | Camel :: Launcher | 53.5s | SUCCESS |
   | Camel :: JBang :: MCP | 44.8s | SUCCESS |
   | Camel :: JBang :: Plugin :: Kubernetes | 25.6s | SUCCESS |
   | Camel :: Kamelet Main | 12.7s | SUCCESS |
   | Camel :: JBang :: Plugin :: Testing | 12.0s | SUCCESS |
   | Camel :: JBang :: Plugin :: Validate | 8.7s | SUCCESS |
   | Camel :: Coverage | 6.2s | SUCCESS |
   | Camel :: JBang :: Plugin :: Generate | 2.2s | SUCCESS |
   | Camel :: JBang :: Plugin :: MCP | 1.8s | SUCCESS |
   | Camel :: JBang :: Plugin :: Edit | 1.4s | SUCCESS |
   | Camel :: JBang :: Plugin :: Route Parser | 1.2s | SUCCESS |
   | Camel :: JBang :: Integration tests | 1.1s | SUCCESS |
   | Camel :: JBang :: Main | 1.0s | SUCCESS |
   | Camel :: Launcher :: Container | 0.8s | SUCCESS |
   | Camel :: JBang :: Core | n/a |  |
   | Camel :: JBang :: Plugin :: TUI | n/a |  |
   
   **Top 20 slowest modules:**
   - `Camel :: Launcher` (53.5s)
   - `Camel :: JBang :: MCP` (44.8s)
   - `Camel :: JBang :: Plugin :: Kubernetes` (25.6s)
   - `Camel :: Kamelet Main` (12.7s)
   - `Camel :: JBang :: Plugin :: Testing` (12.0s)
   - `Camel :: JBang :: Plugin :: Validate` (8.7s)
   - `Camel :: Coverage` (6.2s)
   - `Camel :: JBang :: Plugin :: Generate` (2.2s)
   - `Camel :: JBang :: Plugin :: MCP` (1.8s)
   - `Camel :: JBang :: Plugin :: Edit` (1.4s)
   - `Camel :: JBang :: Plugin :: Route Parser` (1.2s)
   - `Camel :: JBang :: Integration tests` (1.1s)
   - `Camel :: JBang :: Main` (1.0s)
   - `Camel :: Launcher :: Container` (0.8s)
   
   </details>
   
   ---
   :gear: [View full build and test results](https://github.com/apache/camel/actions/runs/36867523527)


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25239: camel-jbang: resolve known imports before kamelet loading [camel]

Posted by "allthingssecurity (via GitHub)" <gi...@apache.org>.
allthingssecurity commented on code in PR #27206:
URL: https://github.com/apache/camel/pull/27206#discussion_r4165000073


##########
dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/ExportTest.java:
##########
@@ -393,6 +394,29 @@ public void shouldExportOfficialKamelet(RuntimeType rt) throws Exception {
         Assertions.assertTrue(f.exists());
     }
 
+    @ParameterizedTest
+    @MethodSource("runtimeProvider")
+    public void shouldExportKameletUsedByJavaRouteWithKnownImport(RuntimeType rt) throws Exception {
+        // The known-import preprocessor must make the Java route compilable before the kamelet is loaded.
+        Assumptions.assumeTrue(rt != RuntimeType.springBoot || Runtime.version().feature() >= 21,
+                "Spring Boot 4 requires JDK 21+");
+        Export command = createCommand(rt,
+                new String[] { "src/test/resources/JacksonKameletRoute.java" });

Review Comment:
   This is why CI is still red. Without extra args, `createCommand` ends with `CommandLine.populateCommand(command, args)` on an empty array. picocli then re-applies the `defaultValue` of every option not on that command line, so `--dir` goes back to `.` (and `--quiet` to `false`). The CI output for this test shows `Exporting as Quarkus project to: .` (and the same for Spring Boot and Main), so `readMavenModel()` finds no `pom.xml` in `workingDir`. I checked the reset with picocli 4.7.7 directly: after a second `populateCommand` with no args, `--dir` is `.` again, while `--runtime` (which has no `defaultValue`) is kept. The other tests in this class pass the three options again for this reason:
   
   ```suggestion
           Export command = createCommand(rt,
                   new String[] { "src/test/resources/JacksonKameletRoute.java" },
                   "--gav=examples:route:1.0.0", "--dir=" + workingDir, "--quiet");
   ```
   
   Heads-up if you ran this test locally: the export to `.` copies with `REPLACE_EXISTING`, so it overwrites `dsl/camel-jbang/camel-jbang-core/pom.xml` and adds the exported files to the module. `git status` there is worth a look before the next push.
   
   On @davsclaus's second question (does the test fail on main without the properties line?): `camel-kamelet-main` has a compile dependency on `camel-jackson`, so `jackson-annotations` is already on this module's test classpath. Once CI is green, it would be good to run the test once with the new `known-third-party-libraries.properties` line removed, to confirm it still guards the fix.
   
   _Claude Code on behalf of allthingssecurity_
   



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25094: camel export: guarantee kamelet spec.dependencies in pom.xml + add jackson-annotations known import [camel]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27206:
URL: https://github.com/apache/camel/pull/27206#issuecomment-5932370312

   :star2: Thank you for your contribution to the Apache Camel project! :star2:
     :robot: CI automation will test this PR automatically.
   
     :camel: Apache Camel Committers, please review the following items:
   
     * First-time contributors **require MANUAL approval** for the GitHub Actions to run
     * You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
     * You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
     * Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
     
     :warning: Be careful when sharing logs. Review their contents before sharing them publicly.


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25239: camel-jbang: resolve known imports before kamelet loading [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #27206:
URL: https://github.com/apache/camel/pull/27206#issuecomment-5952756452

   @smongiar, thank you for digging into this. Your reproducer showed a real gap. We followed it up in #27283, which takes a different route from the one discussed here:
   
   - The root cause was that an `import` of any class of a Camel component other than the component class itself (for example `org.apache.camel.component.aws2.s3.AWS2S3Constants`, for the headers of the `aws-s3-source` Kamelet) didn't resolve. The source failed to compile before the Kamelet could load, so its `spec.dependencies` never reached the exported pom.
   - #27283 makes the known imports find a component by its package. The source then compiles, the Kamelet loads, and its dependencies are recorded as usual, for `camel run` as well as `camel export`.
   - Jackson couldn't show the problem, because the CLI always ships `camel-jackson`. A library that is neither known nor a component is still declared with `--dep`.
   
   Since #27283 covers CAMEL-25239, I suggest closing this PR in favour of it. Your report is credited in the commit and the PR. Thanks again!
   
   _Claude Code on behalf of davsclaus_


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25094: camel export: guarantee kamelet spec.dependencies in pom.xml + add jackson-annotations known import [camel]

Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #27206:
URL: https://github.com/apache/camel/pull/27206#discussion_r4157290760


##########
dsl/camel-kamelet-main/src/main/known-third-party-libraries.properties:
##########
@@ -140,6 +140,7 @@ com.twilio = com.twilio.sdk:twilio:${twilio-version}
 com.stripe = com.stripe:stripe-java:${stripe-java-version}
 
 # Data: JSON, YAML, CSV, XML, binary formats and transformations
+com.fasterxml.jackson.annotation = com.fasterxml.jackson.core:jackson-annotations:${jackson2-version}

Review Comment:
   Since 2.20, jackson-annotations uses two-part versions, so `${jackson2-version}` (2.22.3) resolves to an artifact that does not exist (404 on Maven Central). The parent pom has `jackson2-annotations-version` (2.20) for this. That said, a route importing `ObjectMapper` already maps to jackson-databind, which brings jackson-annotations in transitively - is this entry needed?



-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25239: camel-jbang: resolve known imports before kamelet loading [camel]

Posted by "smongiar (via GitHub)" <gi...@apache.org>.
smongiar commented on PR #27206:
URL: https://github.com/apache/camel/pull/27206#issuecomment-5952901311

   Closing in favour of #27283 which fixes the root cause more broadly (making the known-imports resolver resolve any Camel component class by package, covering both `camel run` and `camel export`). Thanks @davsclaus and @gnodet for the thorough review and the proper fix!


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] CAMEL-25239: camel-jbang: resolve known imports before kamelet loading [camel]

Posted by "smongiar (via GitHub)" <gi...@apache.org>.
smongiar closed pull request #27206: CAMEL-25239: camel-jbang: resolve known imports before kamelet loading
URL: https://github.com/apache/camel/pull/27206


-- 
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: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org