This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new 1b5c166fff Add cli-debug JVM only extension
1b5c166fff is described below
commit 1b5c166fffe57c17a864b03d1d0b618507f3a1f8
Author: James Netherton <[email protected]>
AuthorDate: Thu Jan 15 09:45:46 2026 +0000
Add cli-debug JVM only extension
Fixes #8040
---
catalog/pom.xml | 13 +++
docs/modules/ROOT/examples/others/cli-debug.yml | 13 +++
docs/modules/ROOT/nav.adoc | 1 +
.../ROOT/pages/reference/extensions/cli-debug.adoc | 41 ++++++++
.../org/apache/camel/quarkus/main/CamelMain.java | 19 ++++
extensions-jvm/cli-debug/deployment/pom.xml | 67 +++++++++++++
.../cli/debug/deployment/CliDebugProcessor.java | 42 +++++++++
extensions-jvm/cli-debug/pom.xml | 39 ++++++++
extensions-jvm/cli-debug/runtime/pom.xml | 104 +++++++++++++++++++++
.../main/resources/META-INF/quarkus-extension.yaml | 34 +++++++
extensions-jvm/pom.xml | 1 +
integration-tests-jvm/cli-debug/pom.xml | 97 +++++++++++++++++++
.../component/cli/debug/it/CliDebugRoutes.java | 27 ++++++
.../src/main/resources/application.properties | 31 ++++++
.../component/cli/debug/it/CliDebugTest.java | 81 ++++++++++++++++
integration-tests-jvm/pom.xml | 1 +
poms/bom/pom.xml | 15 +++
poms/bom/src/main/generated/flattened-full-pom.xml | 15 +++
.../src/main/generated/flattened-reduced-pom.xml | 15 +++
.../generated/flattened-reduced-verbose-pom.xml | 15 +++
20 files changed, 671 insertions(+)
diff --git a/catalog/pom.xml b/catalog/pom.xml
index fa9fb58756..75b25aac0e 100644
--- a/catalog/pom.xml
+++ b/catalog/pom.xml
@@ -812,6 +812,19 @@
</exclusion>
</exclusions>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-cli-debug</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-cloudevents</artifactId>
diff --git a/docs/modules/ROOT/examples/others/cli-debug.yml
b/docs/modules/ROOT/examples/others/cli-debug.yml
new file mode 100644
index 0000000000..359d08caf2
--- /dev/null
+++ b/docs/modules/ROOT/examples/others/cli-debug.yml
@@ -0,0 +1,13 @@
+# Do not edit directly!
+# This file was generated by
camel-quarkus-maven-plugin:update-extension-doc-page
+cqArtifactId: camel-quarkus-cli-debug
+cqArtifactIdBase: cli-debug
+cqNativeSupported: false
+cqStatus: Preview
+cqDeprecated: false
+cqJvmSince: 3.31.0
+cqNativeSince: n/a
+cqCamelPartName: cli-debug
+cqCamelPartTitle: CLI Debug
+cqCamelPartDescription: Remote CLI debugger
+cqExtensionPageTitle: CLI Debug
diff --git a/docs/modules/ROOT/nav.adoc b/docs/modules/ROOT/nav.adoc
index 3aeb8294c3..001817965f 100644
--- a/docs/modules/ROOT/nav.adoc
+++ b/docs/modules/ROOT/nav.adoc
@@ -81,6 +81,7 @@
*** xref:reference/extensions/browse.adoc[Browse]
*** xref:reference/extensions/cbor.adoc[CBOR]
*** xref:reference/extensions/cli-connector.adoc[CLI Connector]
+*** xref:reference/extensions/cli-debug.adoc[CLI Debug]
*** xref:reference/extensions/cm-sms.adoc[CM SMS Gateway]
*** xref:reference/extensions/csv.adoc[CSV]
*** xref:reference/extensions/csimple.adoc[CSimple]
diff --git a/docs/modules/ROOT/pages/reference/extensions/cli-debug.adoc
b/docs/modules/ROOT/pages/reference/extensions/cli-debug.adoc
new file mode 100644
index 0000000000..394f03c6fb
--- /dev/null
+++ b/docs/modules/ROOT/pages/reference/extensions/cli-debug.adoc
@@ -0,0 +1,41 @@
+// Do not edit directly!
+// This file was generated by
camel-quarkus-maven-plugin:update-extension-doc-page
+[id="extensions-cli-debug"]
+= CLI Debug
+:linkattrs:
+:cq-artifact-id: camel-quarkus-cli-debug
+:cq-native-supported: false
+:cq-status: Preview
+:cq-status-deprecation: Preview
+:cq-description: Remote CLI debugger
+:cq-deprecated: false
+:cq-jvm-since: 3.31.0
+:cq-native-since: n/a
+
+ifeval::[{doc-show-badges} == true]
+[.badges]
+[.badge-key]##JVM since##[.badge-supported]##3.31.0##
[.badge-key]##Native##[.badge-unsupported]##unsupported##
+endif::[]
+
+Remote CLI debugger
+
+[id="extensions-cli-debug-whats-inside"]
+== What's inside
+
+* xref:{cq-camel-components}:others:cli-debug.adoc[CLI Debug]
+
+Please refer to the above link for usage and configuration details.
+
+[id="extensions-cli-debug-maven-coordinates"]
+== Maven coordinates
+
+[source,xml]
+----
+<dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-cli-debug</artifactId>
+</dependency>
+----
+ifeval::[{doc-show-user-guide-link} == true]
+Check the xref:user-guide/index.adoc[User guide] for more information about
writing Camel Quarkus applications.
+endif::[]
diff --git
a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java
b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java
index 079a0341ba..d0db3ca8e9 100644
---
a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java
+++
b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMain.java
@@ -25,12 +25,16 @@ import java.util.concurrent.atomic.AtomicBoolean;
import io.quarkus.runtime.Quarkus;
import org.apache.camel.CamelContext;
import org.apache.camel.ProducerTemplate;
+import org.apache.camel.RoutesBuilder;
import org.apache.camel.main.MainCommandLineSupport;
import org.apache.camel.main.MainConfigurationProperties;
import org.apache.camel.main.MainShutdownStrategy;
import org.apache.camel.main.SimpleMainShutdownStrategy;
import org.apache.camel.quarkus.core.CamelConfig.FailureRemedy;
import org.apache.camel.spi.HasCamelContext;
+import org.apache.camel.spi.Resource;
+import org.apache.camel.spi.ResourceAware;
+import org.apache.camel.support.ResourceHelper;
import org.apache.camel.support.service.ServiceHelper;
import org.apache.camel.util.StringHelper;
@@ -99,6 +103,21 @@ public final class CamelMain extends MainCommandLineSupport
implements HasCamelC
return mainConfigurationProperties;
}
+ @Override
+ protected void configureRoutes(CamelContext camelContext) throws Exception
{
+ if (camelContext.isSourceLocationEnabled()) {
+ for (RoutesBuilder route :
getMainConfigurationProperties().getRoutesBuilders()) {
+ if (route instanceof ResourceAware ra && ra.getResource() ==
null) {
+ Resource resource =
ResourceHelper.resolveResource(camelContext, "source:" +
route.getClass().getName());
+ if (resource != null && resource.exists()) {
+ ra.setResource(resource);
+ }
+ }
+ }
+ }
+ super.configureRoutes(camelContext);
+ }
+
/**
* Start the engine.
*/
diff --git a/extensions-jvm/cli-debug/deployment/pom.xml
b/extensions-jvm/cli-debug/deployment/pom.xml
new file mode 100644
index 0000000000..dca225b1a3
--- /dev/null
+++ b/extensions-jvm/cli-debug/deployment/pom.xml
@@ -0,0 +1,67 @@
+<?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.quarkus</groupId>
+ <artifactId>camel-quarkus-cli-debug-parent</artifactId>
+ <version>3.31.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-cli-debug-deployment</artifactId>
+ <name>Camel Quarkus :: CLI Debug :: Deployment</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-core-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-cli-connector-deployment</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-cli-debug</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <annotationProcessorPaths>
+ <path>
+ <groupId>io.quarkus</groupId>
+
<artifactId>quarkus-extension-processor</artifactId>
+ <version>${quarkus.version}</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git
a/extensions-jvm/cli-debug/deployment/src/main/java/org/apache/camel/quarkus/component/cli/debug/deployment/CliDebugProcessor.java
b/extensions-jvm/cli-debug/deployment/src/main/java/org/apache/camel/quarkus/component/cli/debug/deployment/CliDebugProcessor.java
new file mode 100644
index 0000000000..cc761362eb
--- /dev/null
+++
b/extensions-jvm/cli-debug/deployment/src/main/java/org/apache/camel/quarkus/component/cli/debug/deployment/CliDebugProcessor.java
@@ -0,0 +1,42 @@
+/*
+ * 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.quarkus.component.cli.debug.deployment;
+
+import io.quarkus.deployment.annotations.BuildStep;
+import io.quarkus.deployment.annotations.ExecutionTime;
+import io.quarkus.deployment.annotations.Record;
+import io.quarkus.deployment.builditem.FeatureBuildItem;
+import io.quarkus.deployment.pkg.steps.NativeOrNativeSourcesBuild;
+import org.apache.camel.quarkus.core.JvmOnlyRecorder;
+import org.jboss.logging.Logger;
+
+class CliDebugProcessor {
+ private static final Logger LOG =
Logger.getLogger(CliDebugProcessor.class);
+ private static final String FEATURE = "camel-cli-debug";
+
+ @BuildStep
+ FeatureBuildItem feature() {
+ return new FeatureBuildItem(FEATURE);
+ }
+
+ @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class)
+ @Record(value = ExecutionTime.RUNTIME_INIT)
+ void warnJvmInNative(JvmOnlyRecorder recorder) {
+ JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
+ recorder.warnJvmInNative(FEATURE); // warn at runtime
+ }
+}
diff --git a/extensions-jvm/cli-debug/pom.xml b/extensions-jvm/cli-debug/pom.xml
new file mode 100644
index 0000000000..b4e817eb32
--- /dev/null
+++ b/extensions-jvm/cli-debug/pom.xml
@@ -0,0 +1,39 @@
+<?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.quarkus</groupId>
+ <artifactId>camel-quarkus-extensions-jvm</artifactId>
+ <version>3.31.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-cli-debug-parent</artifactId>
+ <name>Camel Quarkus :: CLI Debug</name>
+ <packaging>pom</packaging>
+
+ <modules>
+ <module>deployment</module>
+ <module>runtime</module>
+ </modules>
+</project>
diff --git a/extensions-jvm/cli-debug/runtime/pom.xml
b/extensions-jvm/cli-debug/runtime/pom.xml
new file mode 100644
index 0000000000..57ab20f96a
--- /dev/null
+++ b/extensions-jvm/cli-debug/runtime/pom.xml
@@ -0,0 +1,104 @@
+<?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.quarkus</groupId>
+ <artifactId>camel-quarkus-cli-debug-parent</artifactId>
+ <version>3.31.0-SNAPSHOT</version>
+ <relativePath>../pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-cli-debug</artifactId>
+ <name>Camel Quarkus :: CLI Debug :: Runtime</name>
+ <description>Remote CLI debugger</description>
+
+ <properties>
+ <camel.quarkus.jvmSince>3.31.0</camel.quarkus.jvmSince>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-cli-connector</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-cli-debug</artifactId>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-extension-maven-plugin</artifactId>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <annotationProcessorPaths>
+ <path>
+ <groupId>io.quarkus</groupId>
+
<artifactId>quarkus-extension-processor</artifactId>
+ <version>${quarkus.version}</version>
+ </path>
+ </annotationProcessorPaths>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+
+ <profiles>
+ <profile>
+ <id>full</id>
+ <activation>
+ <property>
+ <name>!quickly</name>
+ </property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>update-extension-doc-page</id>
+ <goals>
+ <goal>update-extension-doc-page</goal>
+ </goals>
+ <phase>process-classes</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
diff --git
a/extensions-jvm/cli-debug/runtime/src/main/resources/META-INF/quarkus-extension.yaml
b/extensions-jvm/cli-debug/runtime/src/main/resources/META-INF/quarkus-extension.yaml
new file mode 100644
index 0000000000..b54dc05138
--- /dev/null
+++
b/extensions-jvm/cli-debug/runtime/src/main/resources/META-INF/quarkus-extension.yaml
@@ -0,0 +1,34 @@
+#
+# 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.
+#
+
+# This is a generated file. Do not edit directly!
+# To re-generate, run the following command from the top level directory:
+#
+# mvn -N cq:update-quarkus-metadata
+#
+---
+name: "Camel CLI Debug"
+description: "Remote CLI debugger"
+metadata:
+ icon-url:
"https://raw.githubusercontent.com/apache/camel-website/main/antora-ui-camel/src/img/logo-d.svg"
+ sponsor: "Apache Software Foundation"
+ unlisted: true
+ guide:
"https://camel.apache.org/camel-quarkus/latest/reference/extensions/cli-debug.html"
+ categories:
+ - "integration"
+ status:
+ - "stable"
diff --git a/extensions-jvm/pom.xml b/extensions-jvm/pom.xml
index 1e50834151..da1aceb2f5 100644
--- a/extensions-jvm/pom.xml
+++ b/extensions-jvm/pom.xml
@@ -45,6 +45,7 @@
<module>chatscript</module>
<module>chunk</module>
<module>cli-connector</module>
+ <module>cli-debug</module>
<module>cm-sms</module>
<module>coap</module>
<module>cometd</module>
diff --git a/integration-tests-jvm/cli-debug/pom.xml
b/integration-tests-jvm/cli-debug/pom.xml
new file mode 100644
index 0000000000..0429860b09
--- /dev/null
+++ b/integration-tests-jvm/cli-debug/pom.xml
@@ -0,0 +1,97 @@
+<?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.quarkus</groupId>
+ <artifactId>camel-quarkus-build-parent-it</artifactId>
+ <version>3.31.0-SNAPSHOT</version>
+ <relativePath>../../poms/build-parent-it/pom.xml</relativePath>
+ </parent>
+
+ <artifactId>camel-quarkus-integration-test-cli-debug</artifactId>
+ <name>Camel Quarkus :: Integration Tests :: CLI Debug</name>
+ <description>Integration tests for Camel Quarkus CLI Debug
extension</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-cli-debug</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer</artifactId>
+ </dependency>
+
+ <!-- test dependencies -->
+ <dependency>
+ <groupId>io.quarkus</groupId>
+ <artifactId>quarkus-junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.awaitility</groupId>
+ <artifactId>awaitility</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>virtualDependencies</id>
+ <activation>
+ <property>
+ <name>!noVirtualDependencies</name>
+ </property>
+ </activation>
+ <dependencies>
+ <!-- The following dependencies guarantee that this module is
built after them. You can update them by running `mvn process-resources
-Pformat -N` from the source tree root directory -->
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-cli-debug-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-timer-deployment</artifactId>
+ <version>${project.version}</version>
+ <type>pom</type>
+ <scope>test</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>*</groupId>
+ <artifactId>*</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+</project>
diff --git
a/integration-tests-jvm/cli-debug/src/main/java/org/apache/camel/quarkus/component/cli/debug/it/CliDebugRoutes.java
b/integration-tests-jvm/cli-debug/src/main/java/org/apache/camel/quarkus/component/cli/debug/it/CliDebugRoutes.java
new file mode 100644
index 0000000000..5ee1c9e2f5
--- /dev/null
+++
b/integration-tests-jvm/cli-debug/src/main/java/org/apache/camel/quarkus/component/cli/debug/it/CliDebugRoutes.java
@@ -0,0 +1,27 @@
+/*
+ * 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.quarkus.component.cli.debug.it;
+
+import org.apache.camel.builder.RouteBuilder;
+
+public class CliDebugRoutes extends RouteBuilder {
+ @Override
+ public void configure() throws Exception {
+ from("timer:greet?delay=-1&repeatCount=1")
+ .log("Hello World!");
+ }
+}
diff --git
a/integration-tests-jvm/cli-debug/src/main/resources/application.properties
b/integration-tests-jvm/cli-debug/src/main/resources/application.properties
new file mode 100644
index 0000000000..3a187eeab8
--- /dev/null
+++ b/integration-tests-jvm/cli-debug/src/main/resources/application.properties
@@ -0,0 +1,31 @@
+## ---------------------------------------------------------------------------
+## 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.
+## ---------------------------------------------------------------------------
+quarkus.log.file.enabled=true
+quarkus.log.file.rotation.enabled=false
+
+# Set up a dedicated log file for CamelCliDebuggerFactory messages
+quarkus.log.handler.file.cli-debug-handler.enabled=true
+quarkus.log.handler.file.cli-debug-handler.path=target/cli-debug.log
+quarkus.log.handler.file.cli-debug-handler.format=%d{yyyy-MM-dd HH:mm:ss}
[cli-debug] %s%e%n
+quarkus.log.category."org.apache.camel.component.cli.debug".handlers=cli-debug-handler
+quarkus.log.category."org.apache.camel.component.cli.debug".use-parent-handlers=false
+
+# Manually start the runtime to avoid blocking test startup
+quarkus.camel.bootstrap.enabled=false
+
+# Avoid blocking shutdown for long periods
+camel.main.shutdownTimeout = 1
diff --git
a/integration-tests-jvm/cli-debug/src/test/java/org/apache/camel/quarkus/component/cli/debug/it/CliDebugTest.java
b/integration-tests-jvm/cli-debug/src/test/java/org/apache/camel/quarkus/component/cli/debug/it/CliDebugTest.java
new file mode 100644
index 0000000000..eb8fe79695
--- /dev/null
+++
b/integration-tests-jvm/cli-debug/src/test/java/org/apache/camel/quarkus/component/cli/debug/it/CliDebugTest.java
@@ -0,0 +1,81 @@
+/*
+ * 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.quarkus.component.cli.debug.it;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.time.Duration;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import io.quarkus.test.junit.QuarkusTest;
+import jakarta.inject.Inject;
+import org.apache.camel.quarkus.main.CamelMain;
+import org.awaitility.Awaitility;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+@QuarkusTest
+class CliDebugTest {
+ private static final Path CLI_DEBUG_LOG_PATH =
Paths.get("target/cli-debug.log");
+
+ @Inject
+ CamelMain main;
+
+ @AfterEach
+ public void afterEach() {
+ try {
+ Files.deleteIfExists(CLI_DEBUG_LOG_PATH);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Test
+ void cliDebugWaitsForDebuggerToAttach() throws IOException,
InterruptedException {
+ ExecutorService executorService = Executors.newSingleThreadExecutor();
+ try {
+ // Manually start the runtime async to avoid blocking
+ executorService.submit(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ main.run(new String[] {});
+ } catch (Exception e) {
+ main.stop();
+ throw new RuntimeException(e);
+ }
+ }
+ });
+
+ // Verify the application is waiting for a debugger connection
+
Awaitility.await().pollInterval(Duration.ofMillis(250)).atMost(Duration.ofSeconds(10)).untilAsserted(()
-> {
+ assertTrue(Files.exists(CLI_DEBUG_LOG_PATH));
+
assertTrue(Files.readString(CLI_DEBUG_LOG_PATH).contains("Waiting for CLI to
remote attach"));
+ });
+ } finally {
+ executorService.shutdownNow();
+ main.stop();
+ assertTrue(executorService.awaitTermination(30, TimeUnit.SECONDS));
+ }
+ }
+}
diff --git a/integration-tests-jvm/pom.xml b/integration-tests-jvm/pom.xml
index f9f8497b22..1c35569d98 100644
--- a/integration-tests-jvm/pom.xml
+++ b/integration-tests-jvm/pom.xml
@@ -43,6 +43,7 @@
<module>chatscript</module>
<module>chunk</module>
<module>cli-connector</module>
+ <module>cli-debug</module>
<module>cm-sms</module>
<module>coap</module>
<module>cometd</module>
diff --git a/poms/bom/pom.xml b/poms/bom/pom.xml
index 684cc79914..c724d68013 100644
--- a/poms/bom/pom.xml
+++ b/poms/bom/pom.xml
@@ -723,6 +723,11 @@
<artifactId>camel-cli-connector</artifactId>
<version>${camel.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-cli-debug</artifactId>
+ <version>${camel.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cloud</artifactId>
@@ -3919,6 +3924,16 @@
<artifactId>camel-quarkus-cli-connector-deployment</artifactId>
<version>${camel-quarkus.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-cli-debug</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-cli-debug-deployment</artifactId>
+ <version>${camel-quarkus.version}</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-cloudevents</artifactId>
diff --git a/poms/bom/src/main/generated/flattened-full-pom.xml
b/poms/bom/src/main/generated/flattened-full-pom.xml
index 373bd0ef62..d247a139f1 100644
--- a/poms/bom/src/main/generated/flattened-full-pom.xml
+++ b/poms/bom/src/main/generated/flattened-full-pom.xml
@@ -639,6 +639,11 @@
<artifactId>camel-cli-connector</artifactId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>4.17.0</version><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ <artifactId>camel-cli-debug</artifactId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ <version>4.17.0</version><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>camel-cloud</artifactId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
@@ -3807,6 +3812,16 @@
<artifactId>camel-quarkus-cli-connector-deployment</artifactId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>3.31.0-SNAPSHOT</version><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ <artifactId>camel-quarkus-cli-debug</artifactId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ <version>3.31.0-SNAPSHOT</version><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ <artifactId>camel-quarkus-cli-debug-deployment</artifactId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ <version>3.31.0-SNAPSHOT</version><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>camel-quarkus-cloudevents</artifactId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
diff --git a/poms/bom/src/main/generated/flattened-reduced-pom.xml
b/poms/bom/src/main/generated/flattened-reduced-pom.xml
index eeb429e2cb..ee358b7fec 100644
--- a/poms/bom/src/main/generated/flattened-reduced-pom.xml
+++ b/poms/bom/src/main/generated/flattened-reduced-pom.xml
@@ -639,6 +639,11 @@
<artifactId>camel-cli-connector</artifactId>
<version>4.17.0</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId>
+ <artifactId>camel-cli-debug</artifactId>
+ <version>4.17.0</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cloud</artifactId>
@@ -3797,6 +3802,16 @@
<artifactId>camel-quarkus-cli-connector-deployment</artifactId>
<version>3.31.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-cli-debug</artifactId>
+ <version>3.31.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId>
+ <artifactId>camel-quarkus-cli-debug-deployment</artifactId>
+ <version>3.31.0-SNAPSHOT</version>
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId>
<artifactId>camel-quarkus-cloudevents</artifactId>
diff --git a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
index 18068a6dd3..91389984f8 100644
--- a/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
+++ b/poms/bom/src/main/generated/flattened-reduced-verbose-pom.xml
@@ -639,6 +639,11 @@
<artifactId>camel-cli-connector</artifactId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>4.17.0</version><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</dependency>
+ <dependency>
+ <groupId>org.apache.camel</groupId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ <artifactId>camel-cli-debug</artifactId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ <version>4.17.0</version><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ </dependency>
<dependency>
<groupId>org.apache.camel</groupId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>camel-cloud</artifactId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
@@ -3797,6 +3802,16 @@
<artifactId>camel-quarkus-cli-connector-deployment</artifactId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<version>3.31.0-SNAPSHOT</version><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
</dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ <artifactId>camel-quarkus-cli-debug</artifactId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ <version>3.31.0-SNAPSHOT</version><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ </dependency>
+ <dependency>
+ <groupId>org.apache.camel.quarkus</groupId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ <artifactId>camel-quarkus-cli-debug-deployment</artifactId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ <version>3.31.0-SNAPSHOT</version><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
+ </dependency>
<dependency>
<groupId>org.apache.camel.quarkus</groupId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->
<artifactId>camel-quarkus-cloudevents</artifactId><!--
org.apache.camel.quarkus:camel-quarkus-bom:${project.version} -->