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 2f9c096aa122 CAMEL-23114: camel-jbang - camel version list - Add 
--vendor flag (#21677)
2f9c096aa122 is described below

commit 2f9c096aa1224d08d6e291a17dd2011b4f1c4cd1
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Mar 2 15:09:49 2026 +0100

    CAMEL-23114: camel-jbang - camel version list - Add --vendor flag (#21677)
    
    * CAMEL-23114: camel-jbang - camel version list - Add --vendor flag
---
 .../pages/jbang-commands/camel-jbang-version-list.adoc |  1 +
 .../META-INF/camel-jbang-commands-metadata.json        |  2 +-
 .../dsl/jbang/core/commands/version/VersionList.java   | 14 +++++++++++++-
 .../camel/dsl/jbang/core/model/VersionListDTO.java     | 18 +++++++++++++++---
 4 files changed, 30 insertions(+), 5 deletions(-)

diff --git 
a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-version-list.adoc
 
b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-version-list.adoc
index 9d649637baea..42218ca2a229 100644
--- 
a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-version-list.adoc
+++ 
b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-version-list.adoc
@@ -36,6 +36,7 @@ camel version list [options]
 | `--tail` | The number of lines from the end of the table to show. |  | int
 | `--to-date` | Filter by release date (exclusive) |  | String
 | `--to-version` | Filter by Camel version (exclusive) |  | String
+| `--vendor` | Vendor of Apache Camel distribution to use when filtering 
versions |  | String
 | `-h,--help` | Display the help and sub-commands |  | boolean
 |===
 
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-commands-metadata.json
 
b/dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-commands-metadata.json
index 5af741efc0b4..d2611e13d023 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-commands-metadata.json
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/generated/resources/META-INF/camel-jbang-commands-metadata.json
@@ -31,6 +31,6 @@
     { "name": "trace", "fullName": "trace", "description": "Tail message 
traces from running Camel integrations", "sourceClass": 
"org.apache.camel.dsl.jbang.core.commands.action.CamelTraceAction", "options": 
[ { "names": "--action", "description": "Action to start, stop, clear, list 
status, or dump traces", "defaultValue": "status", "javaType": 
"java.lang.String", "type": "string" }, { "names": "--ago", "description": "Use 
ago instead of yyyy-MM-dd HH:mm:ss in timestamp.", "javaType": "b [...]
     { "name": "transform", "fullName": "transform", "description": "Transform 
message or Camel routes", "sourceClass": 
"org.apache.camel.dsl.jbang.core.commands.TransformCommand", "options": [ { 
"names": "-h,--help", "description": "Display the help and sub-commands", 
"javaType": "boolean", "type": "boolean" } ], "subcommands": [ { "name": 
"message", "fullName": "transform message", "description": "Transform message 
from one format to another via an existing running Camel integration", " [...]
     { "name": "update", "fullName": "update", "description": "Update Camel 
project", "sourceClass": 
"org.apache.camel.dsl.jbang.core.commands.update.UpdateCommand", "options": [ { 
"names": "-h,--help", "description": "Display the help and sub-commands", 
"javaType": "boolean", "type": "boolean" } ], "subcommands": [ { "name": 
"list", "fullName": "update list", "description": "List available update 
versions for Camel and its runtime variants", "sourceClass": 
"org.apache.camel.dsl.jbang.cor [...]
-    { "name": "version", "fullName": "version", "description": "Manage Camel 
versions", "sourceClass": 
"org.apache.camel.dsl.jbang.core.commands.version.VersionCommand", "options": [ 
{ "names": "-h,--help", "description": "Display the help and sub-commands", 
"javaType": "boolean", "type": "boolean" } ], "subcommands": [ { "name": "get", 
"fullName": "version get", "description": "Displays current Camel version", 
"sourceClass": "org.apache.camel.dsl.jbang.core.commands.version.VersionGet", 
[...]
+    { "name": "version", "fullName": "version", "description": "Manage Camel 
versions", "sourceClass": 
"org.apache.camel.dsl.jbang.core.commands.version.VersionCommand", "options": [ 
{ "names": "-h,--help", "description": "Display the help and sub-commands", 
"javaType": "boolean", "type": "boolean" } ], "subcommands": [ { "name": "get", 
"fullName": "version get", "description": "Displays current Camel version", 
"sourceClass": "org.apache.camel.dsl.jbang.core.commands.version.VersionGet", 
[...]
   ]
 }
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/version/VersionList.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/version/VersionList.java
index 5669fa5fa90c..049b3017e9f4 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/version/VersionList.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/version/VersionList.java
@@ -110,6 +110,10 @@ public class VersionList extends CamelCommand {
                         description = "Additional maven repositories (Use 
commas to separate multiple repositories)")
     public String repositories;
 
+    @CommandLine.Option(names = { "--vendor" },
+                        description = "Vendor of Apache Camel distribution to 
use when filtering versions")
+    public String vendor;
+
     @CommandLine.Option(names = { "--lts" }, description = "Only show LTS 
supported releases", defaultValue = "false")
     public boolean lts;
 
@@ -184,6 +188,8 @@ public class VersionList extends CamelCommand {
                     rows, r -> r.runtimeVersion, (r, v) -> r.quarkusVersion = 
v);
         }
 
+        filterVendor(vendor, rows);
+
         if (lts) {
             rows.removeIf(r -> !"lts".equalsIgnoreCase(r.kind));
         }
@@ -234,7 +240,7 @@ public class VersionList extends CamelCommand {
                             rows.stream()
                                     .map(row -> new VersionListDTO(
                                             row.coreVersion, 
runtime.runtime(), row.runtimeVersion,
-                                            row.quarkusVersion, row.jdks, 
row.kind,
+                                            row.quarkusVersion, vendor, 
row.jdks, row.kind,
                                             row.releaseDate, row.eolDate))
                                     .map(VersionListDTO::toMap)
                                     .collect(Collectors.toList())));
@@ -285,6 +291,12 @@ public class VersionList extends CamelCommand {
         return 0;
     }
 
+    private void filterVendor(String vendor, List<Row> rows) {
+        if (vendor != null && !vendor.isBlank()) {
+            rows.removeIf(r -> !r.coreVersion.contains(vendor));
+        }
+    }
+
     public static JsonObject updateCheckerFile(JsonObject root, String 
runtime, String repositories) {
         if (repositories == null) {
             repositories = "";
diff --git 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/model/VersionListDTO.java
 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/model/VersionListDTO.java
index e69965ff4c19..bd90e1474344 100644
--- 
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/model/VersionListDTO.java
+++ 
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/model/VersionListDTO.java
@@ -26,6 +26,7 @@ public class VersionListDTO {
     private String runtime;
     private String runtimeVersion;
     private String quarkusVersion;
+    private String vendor;
     private String jdkVersion;
     private String kind;
     private String releaseDate;
@@ -35,13 +36,13 @@ public class VersionListDTO {
     }
 
     public VersionListDTO(String camelVersion, String runtime, String 
runtimeVersion, String quarkusVersion,
-                          String jdkVersion, String kind,
-                          String releaseDate,
-                          String eolDate) {
+                          String vendor, String jdkVersion, String kind,
+                          String releaseDate, String eolDate) {
         this.camelVersion = camelVersion;
         this.runtime = runtime;
         this.runtimeVersion = runtimeVersion;
         this.quarkusVersion = quarkusVersion;
+        this.vendor = vendor;
         this.jdkVersion = jdkVersion;
         this.kind = kind;
         this.releaseDate = releaseDate;
@@ -80,6 +81,14 @@ public class VersionListDTO {
         this.quarkusVersion = quarkusVersion;
     }
 
+    public String getVendor() {
+        return vendor;
+    }
+
+    public void setVendor(String vendor) {
+        this.vendor = vendor;
+    }
+
     public String getJdkVersion() {
         return jdkVersion;
     }
@@ -122,6 +131,9 @@ public class VersionListDTO {
         if (quarkusVersion != null) {
             jo.put("quarkusVersion", quarkusVersion);
         }
+        if (vendor != null) {
+            jo.put("vendor", vendor);
+        }
         if (jdkVersion != null) {
             jo.put("jdkVersion", jdkVersion);
         }

Reply via email to