You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/05/05 18:01:53 UTC

[camel] branch main updated: CAMEL-18063: camel-jbang - Using --deps for debug may store null as GAV version

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/main by this push:
     new e0fcb229e87 CAMEL-18063: camel-jbang - Using --deps for debug may store null as GAV version
e0fcb229e87 is described below

commit e0fcb229e871593bec8fc7ac0f230f1bb0916841
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Thu May 5 20:01:42 2022 +0200

    CAMEL-18063: camel-jbang - Using --deps for debug may store null as GAV version
---
 .../src/main/java/org/apache/camel/main/MavenGav.java          | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/MavenGav.java b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/MavenGav.java
index c79a66f3efd..b72f3c7485e 100644
--- a/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/MavenGav.java
+++ b/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/MavenGav.java
@@ -17,6 +17,7 @@
 package org.apache.camel.main;
 
 import org.apache.camel.CamelContext;
+import org.apache.camel.util.StringHelper;
 
 /**
  * Maven GAV model
@@ -59,6 +60,15 @@ public final class MavenGav {
             if (context != null) {
                 answer.setVersion(context.getVersion());
             }
+        } else if (gav.startsWith("org.apache.camel:")) {
+            String[] parts = gav.split(":");
+            answer.setGroupId(parts[0]);
+            answer.setArtifactId(parts[1]);
+            if (parts.length == 3) {
+                answer.setVersion(parts[2]);
+            } else if (context != null) {
+                answer.setVersion(context.getVersion());
+            }
         } else if (gav.startsWith("github:")) {
             // TODO: currently not supported
             return answer;