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/03/18 10:35:34 UTC

[camel] branch main updated: camel-jbang - Maven GAV resolution. Detect users use different style and pick vanilla camel components.

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 d9f0597  camel-jbang - Maven GAV resolution. Detect users use different style and pick vanilla camel components.
d9f0597 is described below

commit d9f0597df307fef800a8fcb91ec064d3b788ae1f
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Mar 18 11:34:37 2022 +0100

    camel-jbang - Maven GAV resolution. Detect users use different style and pick vanilla camel components.
---
 .../src/main/java/org/apache/camel/main/MavenGav.java    | 16 ++++++++++++++++
 1 file changed, 16 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 5670734..c79a66f 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
@@ -36,6 +36,10 @@ public final class MavenGav {
         if (gav.startsWith("camel:")) {
             answer.setGroupId("org.apache.camel");
             String a = gav.substring(6);
+            // users may mistakenly use quarkus extension but they should just refer to the vanilla component name
+            if (a.startsWith("camel-quarkus-")) {
+                a = "camel-" + a.substring(14);
+            }
             if (!a.startsWith("camel-")) {
                 a = "camel-" + a;
             }
@@ -43,6 +47,18 @@ public final class MavenGav {
             if (context != null) {
                 answer.setVersion(context.getVersion());
             }
+        } else if (gav.startsWith("camel-") && !(gav.contains(":") || gav.contains("/"))) {
+            // not really camel-k style but users may mistakenly use camel-file instead of camel:file
+            answer.setGroupId("org.apache.camel");
+            String a = gav;
+            // users may mistakenly use quarkus extension but they should just refer to the vanilla component name
+            if (a.startsWith("camel-quarkus-")) {
+                a = "camel-" + a.substring(14);
+            }
+            answer.setArtifactId(a);
+            if (context != null) {
+                answer.setVersion(context.getVersion());
+            }
         } else if (gav.startsWith("github:")) {
             // TODO: currently not supported
             return answer;