smongiar commented on code in PR #30221:
URL: https://github.com/apache/camel/pull/30221#discussion_r4588633934


##########
dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/util/VersionHelper.java:
##########
@@ -124,6 +127,21 @@ public static String extractKameletsVersion() {
             }
         }
 
+        // Executable JARs do not expose their nested dependencies in 
java.class.path.
+        try (InputStream is = VersionHelper.class.getResourceAsStream(
+                
"/META-INF/maven/org.apache.camel.kamelets/camel-kamelets/pom.properties")) {
+            if (is != null) {
+                Properties properties = new Properties();
+                properties.load(is);
+                String version = properties.getProperty("version");
+                if (ObjectHelper.isNotEmpty(version)) {
+                    return version;
+                }
+            }
+        } catch (IOException e) {

Review Comment:
   Added debug logging with the IOException details while retaining the default 
fallback. Added a regression test with an unreadable metadata stream to 
exercise that path.



##########
docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc:
##########
@@ -8689,6 +8689,12 @@ dead letter channel or a handled `onException`, so that 
the item is marked consu
 `delay`, or set `backoffIdleThreshold` and `backoffMultiplier`: a poll counts 
only the items that it marked consumed,
 so a poll whose items all failed is an idle poll, after which a `greedy` 
consumer does not poll again at once.
 
+=== camel-jbang - Kamelets version detection in executable launchers
+
+When exporting without `--kamelets-version`, Camel CLI now detects the 
Kamelets catalog bundled inside an executable

Review Comment:
   Removed the upgrade-guide entry. The bundled and fallback versions are 
aligned in the Apache distribution, so this is a shared detection safety net 
rather than a migration step. Created CAMEL-27072 and aligned the PR title and 
amended commit subject with that ticket: 
https://issues.apache.org/jira/browse/CAMEL-27072



##########
dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/util/VersionHelper.java:
##########
@@ -124,6 +127,21 @@ public static String extractKameletsVersion() {
             }
         }
 
+        // Executable JARs do not expose their nested dependencies in 
java.class.path.

Review Comment:
   Updated the comment to cover both nested JARs and manifest Class-Path 
distributions. Verified original/revised detection for both layouts and the 
ordinary classpath; the revised helper detects the bundled catalog in both 
launcher layouts and preserves filename-based detection.



-- 
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]

Reply via email to