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

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


The following commit(s) were added to refs/heads/camel-4.18.x by this push:
     new ef7e1b4d740b CAMEL-23114: camel-jbang - camel version list - Add 
--vendor flag (#21677)
ef7e1b4d740b is described below

commit ef7e1b4d740b12762a4d938f53f30fac9faba8d8
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
---
 .../jbang-commands/camel-jbang-version-list.adoc      |  1 +
 .../META-INF/camel-jbang-commands-metadata.json       |  2 +-
 .../dsl/jbang/core/commands/version/VersionList.java  | 18 +++++++++++++++---
 .../camel/dsl/jbang/core/model/VersionListDTO.java    | 19 ++++++++++++++++---
 4 files changed, 33 insertions(+), 7 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 040138e6926b..8decb9d66af9 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 813b2dbd1b89..8ae9d858687b 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
@@ -109,6 +109,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;
 
@@ -177,6 +181,8 @@ public class VersionList extends CamelCommand {
         List<Row> rows = new ArrayList<>();
         filterVersions(versions, rows, releases);
 
+        filterVendor(vendor, rows);
+
         if (lts) {
             rows.removeIf(r -> !"lts".equalsIgnoreCase(r.kind));
         }
@@ -226,9 +232,9 @@ public class VersionList extends CamelCommand {
                     Jsoner.serialize(
                             rows.stream()
                                     .map(row -> new VersionListDTO(
-                                            row.coreVersion, 
runtime.runtime(), row.runtimeVersion, row.jdks, row.kind,
-                                            row.releaseDate,
-                                            row.eolDate))
+                                            row.coreVersion, 
runtime.runtime(), row.runtimeVersion,
+                                            vendor, row.jdks, row.kind,
+                                            row.releaseDate, row.eolDate))
                                     .map(VersionListDTO::toMap)
                                     .collect(Collectors.toList())));
         } else {
@@ -275,6 +281,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 1cc805181e4a..3ee26e3f6b22 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
@@ -25,6 +25,7 @@ public class VersionListDTO {
     private String camelVersion;
     private String runtime;
     private String runtimeVersion;
+    private String vendor;
     private String jdkVersion;
     private String kind;
     private String releaseDate;
@@ -33,12 +34,13 @@ public class VersionListDTO {
     public VersionListDTO() {
     }
 
-    public VersionListDTO(String camelVersion, String runtime, String 
runtimeVersion, String jdkVersion, String kind,
-                          String releaseDate,
-                          String eolDate) {
+    public VersionListDTO(String camelVersion, String runtime, String 
runtimeVersion,
+                          String vendor, String jdkVersion, String kind,
+                          String releaseDate, String eolDate) {
         this.camelVersion = camelVersion;
         this.runtime = runtime;
         this.runtimeVersion = runtimeVersion;
+        this.vendor = vendor;
         this.jdkVersion = jdkVersion;
         this.kind = kind;
         this.releaseDate = releaseDate;
@@ -69,6 +71,14 @@ public class VersionListDTO {
         this.runtimeVersion = runtimeVersion;
     }
 
+    public String getVendor() {
+        return vendor;
+    }
+
+    public void setVendor(String vendor) {
+        this.vendor = vendor;
+    }
+
     public String getJdkVersion() {
         return jdkVersion;
     }
@@ -108,6 +118,9 @@ public class VersionListDTO {
         if (runtimeVersion != null) {
             jo.put("runtimeVersion", runtimeVersion);
         }
+        if (vendor != null) {
+            jo.put("vendor", vendor);
+        }
         if (jdkVersion != null) {
             jo.put("jdkVersion", jdkVersion);
         }

Reply via email to