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 2527259253d4 CAMEL-25587: camel-jbang - remove the route-parser
plugin, use camel cmd route-structure instead (#27723)
2527259253d4 is described below
commit 2527259253d4badd9972108237f15dd09a00be4e
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Oct 12 20:12:18 2026 +0200
CAMEL-25587: camel-jbang - remove the route-parser plugin, use camel cmd
route-structure instead (#27723)
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
---
bom/camel-bom/pom.xml | 5 -
coverage/pom.xml | 5 -
.../ROOT/pages/camel-4x-upgrade-guide-4_24.adoc | 7 +
.../modules/ROOT/pages/camel-jbang-projects.adoc | 1 -
.../pages/jbang-commands/camel-jbang-commands.adoc | 1 -
.../jbang-commands/camel-jbang-route-parser.adoc | 29 -----
.../camel/dsl/jbang/core/common/PluginType.java | 1 -
.../camel-jbang-plugin-route-parser/pom.xml | 78 -----------
.../camel-jbang-plugin-commands-metadata.json | 5 -
.../camel-jbang-plugin-route-parser | 2 -
.../jbang/core/commands/parser/ParserPlugin.java | 32 -----
.../core/commands/parser/RouteParserCommand.java | 143 ---------------------
dsl/camel-jbang/camel-launcher/pom.xml | 1 -
dsl/camel-jbang/pom.xml | 1 -
parent/pom.xml | 5 -
15 files changed, 7 insertions(+), 309 deletions(-)
diff --git a/bom/camel-bom/pom.xml b/bom/camel-bom/pom.xml
index b4e1ad15837a..c172734deeac 100644
--- a/bom/camel-bom/pom.xml
+++ b/bom/camel-bom/pom.xml
@@ -1362,11 +1362,6 @@
<artifactId>camel-jbang-plugin-kubernetes</artifactId>
<version>4.23.0-SNAPSHOT</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-jbang-plugin-route-parser</artifactId>
- <version>4.23.0-SNAPSHOT</version>
- </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jbang-plugin-test</artifactId>
diff --git a/coverage/pom.xml b/coverage/pom.xml
index 57bee44e6586..eb720c637693 100644
--- a/coverage/pom.xml
+++ b/coverage/pom.xml
@@ -2512,11 +2512,6 @@
<artifactId>camel-jbang-plugin-kubernetes</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-jbang-plugin-route-parser</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jbang-plugin-test</artifactId>
diff --git
a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
index 94a6e5353229..60ebcf049b21 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc
@@ -67,3 +67,10 @@ camel-route-parser (Roaster). XML routes are read as before.
The parser reads ev
file, including those of a route builder created inside a test, so `validate`
can find and validate endpoints it did
not see before. An endpoint uri that is only a method call, such as
`from(inboxQueue())`, is not validated (it was
validated as a property placeholder without a component before); with
`logUnparseable=true` it is logged.
+
+=== camel-jbang - the route-parser plugin is removed
+
+The `route-parser` plugin (`camel route-parser`) and its
`camel-jbang-plugin-route-parser` artifact are removed. Use
+`camel cmd route-structure MyRoute.java` instead: it prints the structure of
the routes of a Java source, read
+without compiling it, and of YAML and XML sources too. If you installed the
plugin, remove it with
+`camel plugin delete route-parser`.
diff --git a/docs/user-manual/modules/ROOT/pages/camel-jbang-projects.adoc
b/docs/user-manual/modules/ROOT/pages/camel-jbang-projects.adoc
index 753c1121f5e6..63272ef00c98 100644
--- a/docs/user-manual/modules/ROOT/pages/camel-jbang-projects.adoc
+++ b/docs/user-manual/modules/ROOT/pages/camel-jbang-projects.adoc
@@ -241,7 +241,6 @@ The plugins of the Apache Camel project:
| tui | `camel tui`: the xref:camel-jbang-tui.adoc[Camel TUI]
| mcp | `camel mcp`: the xref:camel-jbang-mcp.adoc[Camel MCP Server]
| edit | `camel edit`: edit a Camel file in the terminal with suggestions and
diagnostics
-| route-parser | `camel route-parser`: parse Java routes and dump their
structure
|===
Plugins bundled with the CLI, such as `tui`, are installed on first use.
diff --git
a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-commands.adoc
b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-commands.adoc
index 304f8d109ecd..ad5934d6c699 100644
---
a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-commands.adoc
+++
b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-commands.adoc
@@ -63,7 +63,6 @@ These commands are provided by plugins. A plugin is installed
with `camel plugin
| xref:jbang-commands/camel-jbang-generate.adoc[camel generate] | `generate` |
Generate source code
| xref:jbang-commands/camel-jbang-kubernetes.adoc[camel kubernetes] |
`kubernetes` | Manage Camel applications running on Kubernetes
| xref:jbang-commands/camel-jbang-mcp.adoc[camel mcp] | `mcp` | MCP server for
AI coding assistants
-| xref:jbang-commands/camel-jbang-route-parser.adoc[camel route-parser] |
`route-parser` | Parses Java route and dumps route structure
| xref:jbang-commands/camel-jbang-test.adoc[camel test] | `test` | Manage
tests for Camel applications
| xref:jbang-commands/camel-jbang-tui.adoc[camel tui] | `tui` | Camel TUI
| xref:jbang-commands/camel-jbang-validate.adoc[camel validate] | `validate` |
Validate Camel source code
diff --git
a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-route-parser.adoc
b/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-route-parser.adoc
deleted file mode 100644
index 2986dc5c5e73..000000000000
---
a/docs/user-manual/modules/ROOT/pages/jbang-commands/camel-jbang-route-parser.adoc
+++ /dev/null
@@ -1,29 +0,0 @@
-
-// AUTO-GENERATED by camel-package-maven-plugin - DO NOT EDIT THIS FILE
-= camel route-parser
-
-Parses Java route and dumps route structure
-
-NOTE: This command is provided by the `route-parser` plugin. Install it with
`camel plugin add route-parser`.
-
-
-== Usage
-
-[source,bash]
-----
-camel route-parser [options]
-----
-
-
-
-== Options
-
-[cols="2,5,1,2",options="header"]
-|===
-| Option | Description | Default | Type
-| `--raw` | To output raw without metadata | | boolean
-| `--watch` | Execute periodically and showing output fullscreen | | boolean
-| `-h,--help` | Display the help and sub-commands | | boolean
-|===
-
-
diff --git
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/PluginType.java
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/PluginType.java
index 997214bd8841..fe6ebd313ccb 100644
---
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/PluginType.java
+++
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/common/PluginType.java
@@ -28,7 +28,6 @@ public enum PluginType {
GENERATE("generate", "generate", "Generate code such as DTOs", "4.8.0",
null, "ASF"),
EDIT("edit", "edit", "Edit Camel files with suggestions", "4.12.0", null,
"ASF"),
TEST("test", "test", "Manage tests for Camel applications", "4.14.0",
null, "ASF"),
- ROUTE_PARSER("route-parser", "route-parser", "Parses Java route and dumps
route structure", "4.17.0", null, "ASF"),
VALIDATE("validate", "validate", "Validate Camel routes", "4.18.0", null,
"ASF"),
MCP("mcp", "mcp", "MCP server for AI coding assistants", "4.21.0", null,
"ASF"),
TUI("tui", "tui", "Camel Dashboard", "4.20.0", null, "ASF");
diff --git a/dsl/camel-jbang/camel-jbang-plugin-route-parser/pom.xml
b/dsl/camel-jbang/camel-jbang-plugin-route-parser/pom.xml
deleted file mode 100644
index 641fc277d4d1..000000000000
--- a/dsl/camel-jbang/camel-jbang-plugin-route-parser/pom.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
- <modelVersion>4.0.0</modelVersion>
-
- <parent>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-jbang-parent</artifactId>
- <version>4.23.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
- </parent>
-
- <artifactId>camel-jbang-plugin-route-parser</artifactId>
-
- <name>Camel :: JBang :: Plugin :: Route Parser</name>
- <description>Camel CLI Route Parser</description>
-
- <properties>
- <firstVersion>4.17.0</firstVersion>
- <label>jbang</label>
- <supportLevel>Stable</supportLevel>
- <camel-prepare-component>false</camel-prepare-component>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-jbang-core</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-route-parser</artifactId>
- </dependency>
- <dependency>
- <groupId>org.jboss.forge.roaster</groupId>
- <artifactId>roaster-jdt</artifactId>
- <version>${roaster-version}</version>
- </dependency>
- </dependencies>
-
- <build>
- <plugins>
- <plugin>
- <!-- the command reference of the plugin commands in the user
manual -->
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-package-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>prepare-jbang-commands</id>
- <goals>
- <goal>prepare-jbang-commands</goal>
- <goal>prepare-jbang-commands-doc</goal>
- </goals>
- <phase>process-classes</phase>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
-</project>
diff --git
a/dsl/camel-jbang/camel-jbang-plugin-route-parser/src/generated/resources/META-INF/camel-jbang-plugin-commands-metadata.json
b/dsl/camel-jbang/camel-jbang-plugin-route-parser/src/generated/resources/META-INF/camel-jbang-plugin-commands-metadata.json
deleted file mode 100644
index 8c9c1d0ea4b6..000000000000
---
a/dsl/camel-jbang/camel-jbang-plugin-route-parser/src/generated/resources/META-INF/camel-jbang-plugin-commands-metadata.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "commands": [
- { "name": "route-parser", "fullName": "route-parser", "description":
"Parses Java route and dumps route structure", "sourceClass":
"org.apache.camel.dsl.jbang.core.commands.parser.RouteParserCommand", "plugin":
"route-parser", "options": [ { "names": "--raw", "description": "To output raw
without metadata", "javaType": "boolean", "type": "boolean" }, { "names":
"--watch", "description": "Execute periodically and showing output fullscreen",
"javaType": "boolean", "type": "boolean" }, [...]
- ]
-}
diff --git
a/dsl/camel-jbang/camel-jbang-plugin-route-parser/src/generated/resources/META-INF/services/org/apache/camel/camel-jbang-plugin/camel-jbang-plugin-route-parser
b/dsl/camel-jbang/camel-jbang-plugin-route-parser/src/generated/resources/META-INF/services/org/apache/camel/camel-jbang-plugin/camel-jbang-plugin-route-parser
deleted file mode 100644
index f89c31e6b57d..000000000000
---
a/dsl/camel-jbang/camel-jbang-plugin-route-parser/src/generated/resources/META-INF/services/org/apache/camel/camel-jbang-plugin/camel-jbang-plugin-route-parser
+++ /dev/null
@@ -1,2 +0,0 @@
-# Generated by camel build tools - do NOT edit this file!
-class=org.apache.camel.dsl.jbang.core.commands.parser.ParserPlugin
diff --git
a/dsl/camel-jbang/camel-jbang-plugin-route-parser/src/main/java/org/apache/camel/dsl/jbang/core/commands/parser/ParserPlugin.java
b/dsl/camel-jbang/camel-jbang-plugin-route-parser/src/main/java/org/apache/camel/dsl/jbang/core/commands/parser/ParserPlugin.java
deleted file mode 100644
index c6608535b448..000000000000
---
a/dsl/camel-jbang/camel-jbang-plugin-route-parser/src/main/java/org/apache/camel/dsl/jbang/core/commands/parser/ParserPlugin.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.dsl.jbang.core.commands.parser;
-
-import org.apache.camel.dsl.jbang.core.commands.CamelJBangMain;
-import org.apache.camel.dsl.jbang.core.common.CamelJBangPlugin;
-import org.apache.camel.dsl.jbang.core.common.Plugin;
-import picocli.CommandLine;
-
-@CamelJBangPlugin(name = "camel-jbang-plugin-route-parser", firstVersion =
"4.17.0")
-public class ParserPlugin implements Plugin {
-
- @Override
- public void customize(CommandLine commandLine, CamelJBangMain main) {
- commandLine.addSubcommand("route-parser", new
RouteParserCommand(main));
- }
-
-}
diff --git
a/dsl/camel-jbang/camel-jbang-plugin-route-parser/src/main/java/org/apache/camel/dsl/jbang/core/commands/parser/RouteParserCommand.java
b/dsl/camel-jbang/camel-jbang-plugin-route-parser/src/main/java/org/apache/camel/dsl/jbang/core/commands/parser/RouteParserCommand.java
deleted file mode 100644
index 1693b6f3d812..000000000000
---
a/dsl/camel-jbang/camel-jbang-plugin-route-parser/src/main/java/org/apache/camel/dsl/jbang/core/commands/parser/RouteParserCommand.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.dsl.jbang.core.commands.parser;
-
-import java.io.File;
-import java.nio.file.Path;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Stack;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.camel.dsl.jbang.core.commands.CamelCommand;
-import org.apache.camel.dsl.jbang.core.commands.CamelJBangMain;
-import org.apache.camel.dsl.jbang.core.commands.CommandHelper;
-import org.apache.camel.parser.RouteBuilderParser;
-import org.apache.camel.parser.model.CamelNodeDetails;
-import org.apache.camel.util.FileUtil;
-import org.apache.camel.util.StopWatch;
-import org.jboss.forge.roaster.Roaster;
-import org.jboss.forge.roaster.model.source.JavaClassSource;
-import org.jline.jansi.Ansi;
-import org.jline.jansi.AnsiConsole;
-import picocli.CommandLine;
-
[email protected](name = "route-parser", description = "Parses Java route
and dumps route structure")
-public class RouteParserCommand extends CamelCommand {
-
- @CommandLine.Parameters(description = { "The Camel RouteBuilder Java
source files to parse." },
- arity = "1..9",
- paramLabel = "<files>",
- parameterConsumer = FilesConsumer.class)
- Path[] filePaths;
- List<String> files = new ArrayList<>();
-
- @CommandLine.Option(names = { "--raw" },
- description = "To output raw without metadata")
- boolean raw;
-
- @CommandLine.Option(names = { "--watch" },
- description = "Execute periodically and showing output
fullscreen")
- boolean watch;
-
- private CommandHelper.ReadConsoleTask waitUserTask;
-
- public RouteParserCommand(CamelJBangMain main) {
- super(main);
- }
-
- @Override
- public Integer doCall() throws Exception {
- int exit;
- final AtomicBoolean running = new AtomicBoolean(true);
- if (watch) {
- Thread t = new Thread(() -> {
- waitUserTask = new CommandHelper.ReadConsoleTask(() ->
running.set(false));
- waitUserTask.run();
- }, "WaitForUser");
- t.start();
- do {
- exit = doWatchCall();
- if (exit == 0) {
- // use 2-sec delay in watch mode
- try {
- StopWatch watch = new StopWatch();
- while (running.get() && watch.taken() < 2000) {
- Thread.sleep(100);
- }
- } catch (Exception e) {
- running.set(false);
- }
- }
- } while (exit == 0 && running.get());
- } else {
- exit = doWatchCall();
- }
- return exit;
- }
-
- protected Integer doWatchCall() throws Exception {
- for (String file : files) {
- Integer code = doDumpFile(file);
- if (code != 0) {
- return code;
- }
- }
- return 0;
- }
-
- protected Integer doDumpFile(String file) throws Exception {
- File f = new File(file);
- if (!f.exists() || !f.isFile()) {
- printer().printErr("File not found: " + file);
- return -1;
- }
- String ext = FileUtil.onlyExt(file);
- if (!"java".equals(ext)) {
- printer().printErr("Only .java source file is supported");
- return -1;
- }
- JavaClassSource clazz = (JavaClassSource) Roaster.parse(f);
- List<CamelNodeDetails> list =
RouteBuilderParser.parseRouteBuilderTree(clazz, file, true);
- if (watch) {
- clearScreen();
- }
- for (var route : list) {
- printer().println();
- if (!raw) {
- printer().printf("Source: %s%n", route.getFileName());
-
printer().println("--------------------------------------------------------------------------------");
- }
- String tree = route.dump(0);
- printer().println(tree);
- printer().println();
- }
- return 0;
- }
-
- protected void clearScreen() {
- AnsiConsole.out().print(Ansi.ansi().eraseScreen().cursor(1, 1));
- }
-
- static class FilesConsumer extends
CamelCommand.ParameterConsumer<RouteParserCommand> {
- protected void doConsumeParameters(Stack<String> args,
RouteParserCommand cmd) {
- String arg = args.pop();
- cmd.files.add(arg);
- }
- }
-
-}
diff --git a/dsl/camel-jbang/camel-launcher/pom.xml
b/dsl/camel-jbang/camel-launcher/pom.xml
index e9178cb1866e..3e35d8067878 100644
--- a/dsl/camel-jbang/camel-launcher/pom.xml
+++ b/dsl/camel-jbang/camel-launcher/pom.xml
@@ -92,7 +92,6 @@
<!-- Pre-installed plugins -->
<!-- the edit plugin is not pre-installed -->
- <!-- the route-parser plugin is not pre-installed -->
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jbang-plugin-generate</artifactId>
diff --git a/dsl/camel-jbang/pom.xml b/dsl/camel-jbang/pom.xml
index a25ca7b5bb4d..812196e94628 100644
--- a/dsl/camel-jbang/pom.xml
+++ b/dsl/camel-jbang/pom.xml
@@ -42,7 +42,6 @@
<module>camel-jbang-plugin-edit</module>
<module>camel-jbang-plugin-kubernetes</module>
<module>camel-jbang-plugin-mcp</module>
- <module>camel-jbang-plugin-route-parser</module>
<module>camel-jbang-plugin-test</module>
<module>camel-jbang-plugin-tui</module>
<module>camel-jbang-plugin-validate</module>
diff --git a/parent/pom.xml b/parent/pom.xml
index 097015f2aca5..77e1be1273a9 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -3308,11 +3308,6 @@
<artifactId>camel-jbang-plugin-kubernetes</artifactId>
<version>${project.version}</version>
</dependency>
- <dependency>
- <groupId>org.apache.camel</groupId>
- <artifactId>camel-jbang-plugin-route-parser</artifactId>
- <version>${project.version}</version>
- </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jbang-plugin-test</artifactId>