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 fcc29910f53 Make CamelMain argument and shutdown config runtime
configurable
fcc29910f53 is described below
commit fcc29910f530a2ab63eb9a819f212d6335a72d8f
Author: James Netherton <[email protected]>
AuthorDate: Thu Nov 12 11:31:09 2026 +0000
Make CamelMain argument and shutdown config runtime configurable
quarkus.camel.main.arguments.on-unknown and
quarkus.camel.main.shutdown.timeout
are only read at runtime, so CamelMainConfig is renamed to
CamelMainRunTimeConfig
with ConfigPhase.RUN_TIME and its values are applied at RUNTIME_INIT.
This allows the unknown argument fail / ignore tests to move into
main-command-mode, so the main-unknown-args-fail and
main-unknown-args-ignore
modules are removed. The obsolete exclusion for #4218 is also removed so
that
the command mode tests run in JVM mode.
Co-authored-by: Claude Opus 5.5 <[email protected]>
---
.../ROOT/pages/reference/extensions/core.adoc | 16 +-
.../core/deployment/CamelBootstrapProcessor.java | 14 +-
.../org/apache/camel/quarkus/main/CamelMain.java | 7 +-
.../camel/quarkus/main/CamelMainRecorder.java | 19 ++-
...MainConfig.java => CamelMainRunTimeConfig.java} | 8 +-
.../camel/quarkus/main/cmd/it/CommandModeTest.java | 31 +++-
integration-tests/main-unknown-args-fail/pom.xml | 176 ---------------------
.../quarkus/main/unknown/args/fail/Routes.java | 28 ----
.../src/main/resources/application.properties | 21 ---
.../args/fail/MainUnknownArgumentFailIT.java | 23 ---
.../args/fail/MainUnknownArgumentFailTest.java | 46 ------
integration-tests/main-unknown-args-ignore/pom.xml | 176 ---------------------
.../quarkus/main/unknown/args/ignore/Routes.java | 28 ----
.../src/main/resources/application.properties | 21 ---
.../args/ignore/MainUnknownArgumentIgnoreIT.java | 23 ---
.../args/ignore/MainUnknownArgumentIgnoreTest.java | 46 ------
integration-tests/pom.xml | 2 -
tooling/scripts/test-categories.yaml | 2 -
tooling/test-list/pom.xml | 2 -
19 files changed, 62 insertions(+), 627 deletions(-)
diff --git a/docs/modules/ROOT/pages/reference/extensions/core.adoc
b/docs/modules/ROOT/pages/reference/extensions/core.adoc
index f79ccc98817..a9da971a903 100644
--- a/docs/modules/ROOT/pages/reference/extensions/core.adoc
+++ b/docs/modules/ROOT/pages/reference/extensions/core.adoc
@@ -363,25 +363,25 @@ The interval at which data is updated in Camel Quarkus
Dev UI pages.
|
link:https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/time/Duration.html[`Duration`]
link:#duration-note-anchor-core[icon:question-circle[title=More information
about the Duration format]]
| `5S`
-a|icon:lock[title=Fixed at build time]
[[quarkus-camel-main-shutdown-timeout]]`link:#quarkus-camel-main-shutdown-timeout[quarkus.camel.main.shutdown.timeout]`
+a|
[[quarkus-camel-bootstrap-enabled]]`link:#quarkus-camel-bootstrap-enabled[quarkus.camel.bootstrap.enabled]`
+
+When set to true, the {@link CamelRuntime} will be started automatically.
+| `boolean`
+| `true`
+
+a|
[[quarkus-camel-main-shutdown-timeout]]`link:#quarkus-camel-main-shutdown-timeout[quarkus.camel.main.shutdown.timeout]`
A timeout (with millisecond precision) to wait for `CamelMain++#++stop()` to
finish
|
link:https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/time/Duration.html[`Duration`]
link:#duration-note-anchor-core[icon:question-circle[title=More information
about the Duration format]]
| `PT3S`
-a|icon:lock[title=Fixed at build time]
[[quarkus-camel-main-arguments-on-unknown]]`link:#quarkus-camel-main-arguments-on-unknown[quarkus.camel.main.arguments.on-unknown]`
+a|
[[quarkus-camel-main-arguments-on-unknown]]`link:#quarkus-camel-main-arguments-on-unknown[quarkus.camel.main.arguments.on-unknown]`
The action to take when `CamelMain` encounters an unknown argument. fail -
Prints the `CamelMain` usage statement and
throws a `RuntimeException` ignore - Suppresses any warnings and the
application startup proceeds as normal warn -
Prints the `CamelMain` usage statement but allows the application startup to
proceed as normal
| `fail`, `warn`, `ignore`
| `warn`
-
-a|
[[quarkus-camel-bootstrap-enabled]]`link:#quarkus-camel-bootstrap-enabled[quarkus.camel.bootstrap.enabled]`
-
-When set to true, the {@link CamelRuntime} will be started automatically.
-| `boolean`
-| `true`
|===
[.configuration-legend]
diff --git
a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelBootstrapProcessor.java
b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelBootstrapProcessor.java
index 51000ce29e3..47ea405654f 100644
---
a/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelBootstrapProcessor.java
+++
b/extensions-core/core/deployment/src/main/java/org/apache/camel/quarkus/core/deployment/CamelBootstrapProcessor.java
@@ -75,7 +75,6 @@ import
org.apache.camel.quarkus.core.deployment.util.PathFilter;
import org.apache.camel.quarkus.core.util.FileUtils;
import org.apache.camel.quarkus.main.CamelMain;
import org.apache.camel.quarkus.main.CamelMainApplication;
-import org.apache.camel.quarkus.main.CamelMainConfig;
import org.apache.camel.quarkus.main.CamelMainRecorder;
import org.apache.camel.spi.ModelJAXBContextFactory;
import org.apache.camel.spi.TypeConverterRegistry;
@@ -268,13 +267,11 @@ class CamelBootstrapProcessor {
CamelMainRecorder recorder,
CamelContextBuildItem context,
List<CamelRoutesBuilderClassBuildItem> routesBuilderClasses,
- List<CamelMainListenerBuildItem> listeners,
- CamelMainConfig config) {
+ List<CamelMainListenerBuildItem> listeners) {
RuntimeValue<CamelMain> main = recorder.createCamelMain(
context.getCamelContext(),
- beanContainer.getValue(),
- config.arguments().onUnknown());
+ beanContainer.getValue());
for (CamelRoutesBuilderClassBuildItem item : routesBuilderClasses) {
// don't add routes builders that are known by the container
@@ -361,7 +358,6 @@ class CamelBootstrapProcessor {
* @param commandLineArguments a reference to the raw command line
arguments as they were passed to the application.
* @param shutdown a reference to a {@link ShutdownContext}
used to register the Camel related shutdown
* tasks.
- * @param camelMainConfig a {@link CamelMainConfig}
*/
@BuildStep
@Record(value = ExecutionTime.RUNTIME_INIT)
@@ -379,8 +375,7 @@ class CamelBootstrapProcessor {
List<RuntimeCamelContextCustomizerBuildItem> customizers,
List<CamelRuntimeTaskBuildItem> runtimeTasks,
RawCommandLineArgumentsBuildItem commandLineArguments,
- ShutdownContextBuildItem shutdown,
- CamelMainConfig camelMainConfig) {
+ ShutdownContextBuildItem shutdown) {
// Run the customizer before starting the context to give a last chance
// to amend the Camel Context setup.
@@ -394,8 +389,7 @@ class CamelBootstrapProcessor {
RuntimeValue<CamelRuntime> runtime = recorder.createRuntime(
beanContainer.getValue(),
- main.getInstance(),
- camelMainConfig.shutdown().timeout().toMillis());
+ main.getInstance());
recorder.addShutdownTask(shutdown, runtime);
if
(index.getIndex().getAnnotations(DotName.createSimple(QuarkusMain.class.getName())).isEmpty())
{
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 4833062fcec..4e9fed193d7 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
@@ -39,11 +39,14 @@ import org.apache.camel.util.StringHelper;
public final class CamelMain extends MainCommandLineSupport implements
HasCamelContext {
private final AtomicBoolean engineStarted;
- private final FailureRemedy failureRemedy;
+ private FailureRemedy failureRemedy = FailureRemedy.warn;
- public CamelMain(CamelContext camelContext, FailureRemedy failureRemedy) {
+ public CamelMain(CamelContext camelContext) {
this.camelContext = camelContext;
this.engineStarted = new AtomicBoolean();
+ }
+
+ void setUnknownArgumentRemedy(FailureRemedy failureRemedy) {
this.failureRemedy = failureRemedy;
}
diff --git
a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java
b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java
index 0957b060396..8f3278da2ae 100644
---
a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java
+++
b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRecorder.java
@@ -30,7 +30,6 @@ import org.apache.camel.RoutesBuilder;
import org.apache.camel.main.BaseMainSupport;
import org.apache.camel.main.MainListener;
import org.apache.camel.main.MainListenerSupport;
-import org.apache.camel.quarkus.core.CamelConfig.FailureRemedy;
import org.apache.camel.quarkus.core.CamelProducers;
import org.apache.camel.quarkus.core.CamelRuntime;
import org.apache.camel.quarkus.core.CamelRuntimeConfig;
@@ -44,15 +43,18 @@ public class CamelMainRecorder {
private static final Logger LOGGER =
Logger.getLogger(CamelMainRecorder.class);
private final RuntimeValue<CamelRuntimeConfig> camelRuntimeConfig;
+ private final RuntimeValue<CamelMainRunTimeConfig> camelMainRunTimeConfig;
- public CamelMainRecorder(RuntimeValue<CamelRuntimeConfig>
camelRuntimeConfig) {
+ public CamelMainRecorder(
+ RuntimeValue<CamelRuntimeConfig> camelRuntimeConfig,
+ RuntimeValue<CamelMainRunTimeConfig> camelMainRunTimeConfig) {
this.camelRuntimeConfig = camelRuntimeConfig;
+ this.camelMainRunTimeConfig = camelMainRunTimeConfig;
}
public RuntimeValue<CamelMain> createCamelMain(RuntimeValue<CamelContext>
runtime,
- BeanContainer container,
- FailureRemedy failureRemedy) {
- CamelMain main = new CamelMain(runtime.getValue(), failureRemedy);
+ BeanContainer container) {
+ CamelMain main = new CamelMain(runtime.getValue());
main.setRoutesCollector(new CamelMainRoutesCollector());
// properties are loaded through MicroProfile Config so there's
@@ -94,9 +96,10 @@ public class CamelMainRecorder {
public RuntimeValue<CamelRuntime> createRuntime(
BeanContainer beanContainer,
- RuntimeValue<CamelMain> main,
- long shutdownTimeoutMs) {
- final CamelRuntime runtime = new CamelMainRuntime(main.getValue(),
shutdownTimeoutMs);
+ RuntimeValue<CamelMain> main) {
+ CamelMainRunTimeConfig config = camelMainRunTimeConfig.getValue();
+
main.getValue().setUnknownArgumentRemedy(config.arguments().onUnknown());
+ final CamelRuntime runtime = new CamelMainRuntime(main.getValue(),
config.shutdown().timeout().toMillis());
// register to the container
beanContainer.beanInstance(CamelProducers.class).setRuntime(runtime);
diff --git
a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainConfig.java
b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRunTimeConfig.java
similarity index 90%
rename from
extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainConfig.java
rename to
extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRunTimeConfig.java
index 27a5f594b4b..23f546058dd 100644
---
a/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainConfig.java
+++
b/extensions-core/core/runtime/src/main/java/org/apache/camel/quarkus/main/CamelMainRunTimeConfig.java
@@ -24,18 +24,18 @@ import io.smallrye.config.ConfigMapping;
import io.smallrye.config.WithDefault;
import org.apache.camel.quarkus.core.CamelConfig.FailureRemedy;
-@ConfigRoot(phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED)
+@ConfigRoot(phase = ConfigPhase.RUN_TIME)
@ConfigMapping(prefix = "quarkus.camel.main")
-public interface CamelMainConfig {
+public interface CamelMainRunTimeConfig {
/**
- * Build time configuration options for `CamelMain` shutdown.
+ * Runtime configuration options for `CamelMain` shutdown.
*
* @asciidoclet
*/
ShutdownConfig shutdown();
/**
- * Build time configuration options for `CamelMain` arguments
+ * Runtime configuration options for `CamelMain` arguments
*
* @asciidoclet
*/
diff --git
a/integration-tests/main-command-mode/src/test/java/org/apache/camel/quarkus/main/cmd/it/CommandModeTest.java
b/integration-tests/main-command-mode/src/test/java/org/apache/camel/quarkus/main/cmd/it/CommandModeTest.java
index 988bbe7ba4b..00e775460e1 100644
---
a/integration-tests/main-command-mode/src/test/java/org/apache/camel/quarkus/main/cmd/it/CommandModeTest.java
+++
b/integration-tests/main-command-mode/src/test/java/org/apache/camel/quarkus/main/cmd/it/CommandModeTest.java
@@ -33,7 +33,6 @@ import org.zeroturnaround.exec.StartedProcess;
import static org.assertj.core.api.Assertions.assertThat;
-@DisabledIfSystemProperty(named = "quarkus.runner", matches = ".*runner.jar",
disabledReason = "https://github.com/apache/camel-quarkus/issues/4218")
public class CommandModeTest {
@Test
@@ -78,6 +77,36 @@ public class CommandModeTest {
assertThat(result.outputUTF8()).contains("Apache Camel Runner takes
the following options");
}
+ @Test
+ void testMainTerminatesOnUnknownArguments() throws InterruptedException,
IOException, TimeoutException {
+ final String[] jvmArgs = new String[] {
+ "-Dquarkus.camel.main.arguments.on-unknown=fail",
+ "-Dcamel.main.duration-max-messages=1"
+ };
+
+ final ProcessResult result = new QuarkusProcessExecutor(jvmArgs, "-d",
"10", "-cp", "foo.jar", "-t").execute();
+
+ assertThat(result.getExitValue()).isEqualTo(1);
+ assertThat(result.outputUTF8()).doesNotContain("Logging Hello World!");
+ assertThat(result.outputUTF8()).contains("Unknown option: -cp
foo.jar");
+ assertThat(result.outputUTF8()).contains("Apache Camel Runner takes
the following options");
+ }
+
+ @Test
+ void testMainIgnoresUnknownArguments() throws InterruptedException,
IOException, TimeoutException {
+ final String[] jvmArgs = new String[] {
+ "-Dquarkus.camel.main.arguments.on-unknown=ignore",
+ "-Dcamel.main.duration-max-messages=1"
+ };
+
+ final ProcessResult result = new QuarkusProcessExecutor(jvmArgs, "-d",
"10", "-cp", "foo.jar", "-t").execute();
+
+ assertThat(result.getExitValue()).isEqualTo(0);
+ assertThat(result.outputUTF8()).contains("Logging Hello World!");
+ assertThat(result.outputUTF8()).doesNotContain("Unknown option: -cp
foo.jar");
+ assertThat(result.outputUTF8()).doesNotContain("Apache Camel Runner
takes the following options");
+ }
+
@Test
@DisabledIfSystemProperty(named = "ci.slow.machine", matches = "true",
disabledReason = "Test is timing-sensitive and may be unreliable on slow
machines")
void testMainStopsAfterMaxSeconds() throws IOException,
InterruptedException, ExecutionException {
diff --git a/integration-tests/main-unknown-args-fail/pom.xml
b/integration-tests/main-unknown-args-fail/pom.xml
deleted file mode 100644
index a79bcefdd00..00000000000
--- a/integration-tests/main-unknown-args-fail/pom.xml
+++ /dev/null
@@ -1,176 +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.quarkus</groupId>
- <artifactId>camel-quarkus-build-parent-it</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <relativePath>../../poms/build-parent-it/pom.xml</relativePath>
- </parent>
-
-
<artifactId>camel-quarkus-integration-test-main-unknown-args-fail</artifactId>
- <name>Camel Quarkus :: Integration Tests :: Main Unknown Arguments Fail ::
Tests</name>
-
- <properties>
-
<quarkus.runner.jar>${project.build.directory}/quarkus-app/quarkus-run.jar</quarkus.runner.jar>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-log</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-timer</artifactId>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-vertx-http</artifactId>
- </dependency>
-
- <!-- test dependencies -->
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
-
<artifactId>camel-quarkus-integration-tests-process-executor-support</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-
- <profiles>
-
- <profile>
- <id>full</id>
- <activation>
- <property>
- <name>!quickly</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <!-- Move surefire:test to integration-test phase to
be able to run
- java -jar target/*runner.jar from a test -->
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>default-test</id>
- <goals>
- <goal>test</goal>
- </goals>
- <phase>integration-test</phase>
- <configuration>
- <systemPropertyVariables>
-
<quarkus.runner>${quarkus.runner.jar}</quarkus.runner>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>native</id>
- <activation>
- <property>
- <name>native</name>
- </property>
- </activation>
- <properties>
- <quarkus.native.enabled>true</quarkus.native.enabled>
-
<quarkus.runner.jar>${project.build.directory}/${project.artifactId}-${project.version}-native-image-source-jar/${project.artifactId}-${project.version}-runner.jar</quarkus.runner.jar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>integration-test</goal>
- <goal>verify</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
-
<quarkus.runner>${project.build.directory}/${project.artifactId}-${project.version}-runner</quarkus.runner>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <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-log-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/main-unknown-args-fail/src/main/java/org/apache/camel/quarkus/main/unknown/args/fail/Routes.java
b/integration-tests/main-unknown-args-fail/src/main/java/org/apache/camel/quarkus/main/unknown/args/fail/Routes.java
deleted file mode 100644
index a5583783808..00000000000
---
a/integration-tests/main-unknown-args-fail/src/main/java/org/apache/camel/quarkus/main/unknown/args/fail/Routes.java
+++ /dev/null
@@ -1,28 +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.quarkus.main.unknown.args.fail;
-
-import org.apache.camel.builder.RouteBuilder;
-
-public class Routes extends RouteBuilder {
-
- @Override
- public void configure() throws Exception {
- from("timer:tick?repeatCount=1")
- .log("Timer tick!");
- }
-}
diff --git
a/integration-tests/main-unknown-args-fail/src/main/resources/application.properties
b/integration-tests/main-unknown-args-fail/src/main/resources/application.properties
deleted file mode 100644
index 62d96d90e81..00000000000
---
a/integration-tests/main-unknown-args-fail/src/main/resources/application.properties
+++ /dev/null
@@ -1,21 +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.
-## ---------------------------------------------------------------------------
-
-# Terminate after 1 message is generated
-camel.main.duration-max-messages = 1
-
-quarkus.camel.main.arguments.on-unknown = fail
diff --git
a/integration-tests/main-unknown-args-fail/src/test/java/org/apache/camel/quarkus/main/unknown/args/fail/MainUnknownArgumentFailIT.java
b/integration-tests/main-unknown-args-fail/src/test/java/org/apache/camel/quarkus/main/unknown/args/fail/MainUnknownArgumentFailIT.java
deleted file mode 100644
index 74f5a7e5016..00000000000
---
a/integration-tests/main-unknown-args-fail/src/test/java/org/apache/camel/quarkus/main/unknown/args/fail/MainUnknownArgumentFailIT.java
+++ /dev/null
@@ -1,23 +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.quarkus.main.unknown.args.fail;
-
-import io.quarkus.test.junit.QuarkusIntegrationTest;
-
-@QuarkusIntegrationTest
-class MainUnknownArgumentFailIT extends MainUnknownArgumentFailTest {
-}
diff --git
a/integration-tests/main-unknown-args-fail/src/test/java/org/apache/camel/quarkus/main/unknown/args/fail/MainUnknownArgumentFailTest.java
b/integration-tests/main-unknown-args-fail/src/test/java/org/apache/camel/quarkus/main/unknown/args/fail/MainUnknownArgumentFailTest.java
deleted file mode 100644
index 53eaf5e5d2c..00000000000
---
a/integration-tests/main-unknown-args-fail/src/test/java/org/apache/camel/quarkus/main/unknown/args/fail/MainUnknownArgumentFailTest.java
+++ /dev/null
@@ -1,46 +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.quarkus.main.unknown.args.fail;
-
-import java.io.IOException;
-import java.util.concurrent.TimeoutException;
-
-import io.quarkus.test.junit.QuarkusTest;
-import org.apache.camel.quarkus.test.support.process.QuarkusProcessExecutor;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
-import org.zeroturnaround.exec.ProcessResult;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-@DisabledIfSystemProperty(named = "quarkus.runner", matches = ".*runner.jar",
disabledReason = "https://github.com/apache/camel-quarkus/issues/4218")
-@QuarkusTest
-public class MainUnknownArgumentFailTest {
-
- @Test
- public void testMainTerminatesOnUnknownArguments() throws
InterruptedException, IOException, TimeoutException {
- final ProcessResult result = new QuarkusProcessExecutor(new String[]
{}, "-d", "10", "-cp", "foo.jar", "-t").execute();
-
- // Verify the application did not run successfully
- assertThat(result.getExitValue()).isEqualTo(1);
- assertThat(result.outputUTF8()).doesNotContain("Timer tick!");
-
- // Verify warning for unknown arguments was printed to the console
- assertThat(result.outputUTF8()).contains("Unknown option: -cp
foo.jar");
- assertThat(result.outputUTF8()).contains("Apache Camel Runner takes
the following options");
- }
-}
diff --git a/integration-tests/main-unknown-args-ignore/pom.xml
b/integration-tests/main-unknown-args-ignore/pom.xml
deleted file mode 100644
index 1d420acf9cf..00000000000
--- a/integration-tests/main-unknown-args-ignore/pom.xml
+++ /dev/null
@@ -1,176 +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.quarkus</groupId>
- <artifactId>camel-quarkus-build-parent-it</artifactId>
- <version>4.0.0-SNAPSHOT</version>
- <relativePath>../../poms/build-parent-it/pom.xml</relativePath>
- </parent>
-
-
<artifactId>camel-quarkus-integration-test-main-unknown-args-ignore</artifactId>
- <name>Camel Quarkus :: Integration Tests :: Main Unknown Arguments Ignore
:: Tests</name>
-
- <properties>
-
<quarkus.runner.jar>${project.build.directory}/quarkus-app/quarkus-run.jar</quarkus.runner.jar>
- </properties>
-
- <dependencies>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-log</artifactId>
- </dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
- <artifactId>camel-quarkus-timer</artifactId>
- </dependency>
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-vertx-http</artifactId>
- </dependency>
-
- <!-- test dependencies -->
- <dependency>
- <groupId>io.quarkus</groupId>
- <artifactId>quarkus-junit</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.assertj</groupId>
- <artifactId>assertj-core</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.camel.quarkus</groupId>
-
<artifactId>camel-quarkus-integration-tests-process-executor-support</artifactId>
- <scope>test</scope>
- </dependency>
- </dependencies>
-
-
- <profiles>
-
- <profile>
- <id>full</id>
- <activation>
- <property>
- <name>!quickly</name>
- </property>
- </activation>
- <build>
- <plugins>
- <plugin>
- <!-- Move surefire:test to integration-test phase to
be able to run
- java -jar target/*runner.jar from a test -->
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>default-test</id>
- <goals>
- <goal>test</goal>
- </goals>
- <phase>integration-test</phase>
- <configuration>
- <systemPropertyVariables>
-
<quarkus.runner>${quarkus.runner.jar}</quarkus.runner>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
-
- <profile>
- <id>native</id>
- <activation>
- <property>
- <name>native</name>
- </property>
- </activation>
- <properties>
- <quarkus.native.enabled>true</quarkus.native.enabled>
-
<quarkus.runner.jar>${project.build.directory}/${project.artifactId}-${project.version}-native-image-source-jar/${project.artifactId}-${project.version}-runner.jar</quarkus.runner.jar>
- </properties>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-failsafe-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>integration-test</goal>
- <goal>verify</goal>
- </goals>
- <configuration>
- <systemPropertyVariables>
-
<quarkus.runner>${project.build.directory}/${project.artifactId}-${project.version}-runner</quarkus.runner>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
- </profile>
- <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-log-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/main-unknown-args-ignore/src/main/java/org/apache/camel/quarkus/main/unknown/args/ignore/Routes.java
b/integration-tests/main-unknown-args-ignore/src/main/java/org/apache/camel/quarkus/main/unknown/args/ignore/Routes.java
deleted file mode 100644
index fe7e2c69bac..00000000000
---
a/integration-tests/main-unknown-args-ignore/src/main/java/org/apache/camel/quarkus/main/unknown/args/ignore/Routes.java
+++ /dev/null
@@ -1,28 +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.quarkus.main.unknown.args.ignore;
-
-import org.apache.camel.builder.RouteBuilder;
-
-public class Routes extends RouteBuilder {
-
- @Override
- public void configure() throws Exception {
- from("timer:tick?repeatCount=1")
- .log("Timer tick!");
- }
-}
diff --git
a/integration-tests/main-unknown-args-ignore/src/main/resources/application.properties
b/integration-tests/main-unknown-args-ignore/src/main/resources/application.properties
deleted file mode 100644
index 6de63fb7ef4..00000000000
---
a/integration-tests/main-unknown-args-ignore/src/main/resources/application.properties
+++ /dev/null
@@ -1,21 +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.
-## ---------------------------------------------------------------------------
-
-# Terminate after 1 message is generated
-camel.main.duration-max-messages = 1
-
-quarkus.camel.main.arguments.on-unknown = ignore
diff --git
a/integration-tests/main-unknown-args-ignore/src/test/java/org/apache/camel/quarkus/main/unknown/args/ignore/MainUnknownArgumentIgnoreIT.java
b/integration-tests/main-unknown-args-ignore/src/test/java/org/apache/camel/quarkus/main/unknown/args/ignore/MainUnknownArgumentIgnoreIT.java
deleted file mode 100644
index 24313bddf88..00000000000
---
a/integration-tests/main-unknown-args-ignore/src/test/java/org/apache/camel/quarkus/main/unknown/args/ignore/MainUnknownArgumentIgnoreIT.java
+++ /dev/null
@@ -1,23 +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.quarkus.main.unknown.args.ignore;
-
-import io.quarkus.test.junit.QuarkusIntegrationTest;
-
-@QuarkusIntegrationTest
-class MainUnknownArgumentIgnoreIT extends MainUnknownArgumentIgnoreTest {
-}
diff --git
a/integration-tests/main-unknown-args-ignore/src/test/java/org/apache/camel/quarkus/main/unknown/args/ignore/MainUnknownArgumentIgnoreTest.java
b/integration-tests/main-unknown-args-ignore/src/test/java/org/apache/camel/quarkus/main/unknown/args/ignore/MainUnknownArgumentIgnoreTest.java
deleted file mode 100644
index 268d18b979d..00000000000
---
a/integration-tests/main-unknown-args-ignore/src/test/java/org/apache/camel/quarkus/main/unknown/args/ignore/MainUnknownArgumentIgnoreTest.java
+++ /dev/null
@@ -1,46 +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.quarkus.main.unknown.args.ignore;
-
-import java.io.IOException;
-import java.util.concurrent.TimeoutException;
-
-import io.quarkus.test.junit.QuarkusTest;
-import org.apache.camel.quarkus.test.support.process.QuarkusProcessExecutor;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
-import org.zeroturnaround.exec.ProcessResult;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-@DisabledIfSystemProperty(named = "quarkus.runner", matches = ".*runner.jar",
disabledReason = "https://github.com/apache/camel-quarkus/issues/4218")
-@QuarkusTest
-public class MainUnknownArgumentIgnoreTest {
-
- @Test
- public void testMainIgnoresUnknownArguments() throws InterruptedException,
IOException, TimeoutException {
- final ProcessResult result = new QuarkusProcessExecutor(new String[]
{}, "-d", "10", "-cp", "foo.jar", "-t").execute();
-
- // Verify the application ran successfully
- assertThat(result.getExitValue()).isEqualTo(0);
- assertThat(result.outputUTF8()).contains("Timer tick!");
-
- // Verify unknown arguments were ignored and no warning was printed to
the console
- assertThat(result.outputUTF8()).doesNotContain("Unknown option: -cp
foo.jar");
- assertThat(result.outputUTF8()).doesNotContain("Apache Camel Runner
takes the following options");
- }
-}
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index f137b7be6bd..1d24e0e7fbe 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -43,8 +43,6 @@
<module>main-xml-jaxb</module>
<module>main-xml-io</module>
<module>main-command-mode</module>
- <module>main-unknown-args-fail</module>
- <module>main-unknown-args-ignore</module>
<module>main-yaml</module>
<!-- extensions a..z; do not remove this comment, it is important when
sorting via mvn process-resources -Pformat -->
diff --git a/tooling/scripts/test-categories.yaml
b/tooling/scripts/test-categories.yaml
index f993067c618..d812287b4d1 100644
--- a/tooling/scripts/test-categories.yaml
+++ b/tooling/scripts/test-categories.yaml
@@ -71,7 +71,6 @@ group-03:
- mail-microsoft-oauth
- main
- main-command-mode
- - main-unknown-args-fail
- main-xml-io
- main-xml-jaxb
- main-yaml
@@ -155,7 +154,6 @@ group-08:
- joor
- jq
- langchain4j-chat
- - main-unknown-args-ignore
- master-file
- pdf
- pinecone
diff --git a/tooling/test-list/pom.xml b/tooling/test-list/pom.xml
index c37efadab63..d167282b015 100644
--- a/tooling/test-list/pom.xml
+++ b/tooling/test-list/pom.xml
@@ -61,8 +61,6 @@
<exclude>master-file/pom.xml</exclude>
<exclude>master-infinispan/pom.xml</exclude>
<exclude>main-command-mode/pom.xml</exclude>
-
<exclude>main-unknown-args-fail/pom.xml</exclude>
-
<exclude>main-unknown-args-ignore/pom.xml</exclude>
<exclude>messaging/pom.xml</exclude>
<exclude>quartz-clustered/pom.xml</exclude>
</excludes>