This is an automated email from the ASF dual-hosted git repository.
apupier 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 0e101544096b CAMEL-23931: camel.jbang.quarkus.platform.url ignored
from application.properties
0e101544096b is described below
commit 0e101544096baf1c734354718e3b2066722fd88b
Author: jomin mathew <>
AuthorDate: Wed Jul 29 16:22:53 2026 +0100
CAMEL-23931: camel.jbang.quarkus.platform.url ignored from
application.properties
QuarkusPlatformMixin.of() only honoured QUARKUS_EXTENSION_REGISTRY_BASE_URI
(camel.jbang.quarkusExtensionRegistryBaseUri) when loading properties, so
setting camel.jbang.quarkus.platform.url in application.properties was
silently ignored - unlike all other camel.jbang.* properties.
Also read QUARKUS_PLATFORM_URL_PROPERTY (camel.jbang.quarkus.platform.url)
from the supplied Properties as a fallback for
quarkusExtensionRegistryBaseUri,
stripping the /client/platforms suffix if present (same logic already
applied
for the system property in QuarkusExtensionRegistryMixin).
This regression was introduced in 4.18.3 by the CAMEL-23353 backport.
---
.../jbang/core/commands/QuarkusPlatformMixin.java | 20 +++-
.../core/commands/QuarkusPlatformMixinTest.java | 121 +++++++++++++++++++++
2 files changed, 140 insertions(+), 1 deletion(-)
diff --git
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/QuarkusPlatformMixin.java
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/QuarkusPlatformMixin.java
index 46b25d1cb434..3b61fc383148 100644
---
a/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/QuarkusPlatformMixin.java
+++
b/dsl/camel-jbang/camel-jbang-core/src/main/java/org/apache/camel/dsl/jbang/core/commands/QuarkusPlatformMixin.java
@@ -95,8 +95,26 @@ public class QuarkusPlatformMixin extends
QuarkusExtensionRegistryMixin implemen
QuarkusPlatformMixin result = new QuarkusPlatformMixin();
result.quarkusGroupId = props.getProperty(QUARKUS_GROUP_ID,
fallback.quarkusGroupId());
result.quarkusVersion = props.getProperty(QUARKUS_VERSION,
fallback.quarkusVersion());
+ // Prefer the canonical camel.jbang.quarkusExtensionRegistryBaseUri
property; also honour the legacy
+ // camel.jbang.quarkus.platform.url property (stripping its
"/client/platforms" suffix if present)
+ // so that users who set it in application.properties are not silently
ignored.
+ String registryBaseUri =
props.getProperty(QUARKUS_EXTENSION_REGISTRY_BASE_URI);
+ if (registryBaseUri == null) {
+ String platformUrl =
props.getProperty(QuarkusHelper.QUARKUS_PLATFORM_URL_PROPERTY);
+ if (platformUrl != null) {
+ final String suffix = "/client/platforms";
+ if (platformUrl.endsWith(suffix)) {
+ platformUrl = platformUrl.substring(0,
platformUrl.length() - suffix.length());
+ }
+ registryBaseUri = platformUrl;
+ }
+ }
+ // strip trailing slash, consistent with
QuarkusExtensionRegistryMixin.quarkusExtensionRegistryBaseUri()
+ if (registryBaseUri != null && registryBaseUri.endsWith("/")) {
+ registryBaseUri = registryBaseUri.substring(0,
registryBaseUri.length() - 1);
+ }
result.quarkusExtensionRegistryBaseUri
- = props.getProperty(QUARKUS_EXTENSION_REGISTRY_BASE_URI,
fallback.quarkusExtensionRegistryBaseUri());
+ = registryBaseUri != null ? registryBaseUri :
fallback.quarkusExtensionRegistryBaseUri();
return result;
}
diff --git
a/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/QuarkusPlatformMixinTest.java
b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/QuarkusPlatformMixinTest.java
new file mode 100644
index 000000000000..d53b047b433d
--- /dev/null
+++
b/dsl/camel-jbang/camel-jbang-core/src/test/java/org/apache/camel/dsl/jbang/core/commands/QuarkusPlatformMixinTest.java
@@ -0,0 +1,121 @@
+/*
+ * 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;
+
+import java.util.Properties;
+
+import org.apache.camel.dsl.jbang.core.common.QuarkusHelper;
+import org.apache.camel.dsl.jbang.core.common.RuntimeType;
+import org.junit.jupiter.api.Test;
+
+import static
org.apache.camel.dsl.jbang.core.common.CamelJBangConstants.QUARKUS_EXTENSION_REGISTRY_BASE_URI;
+import static org.assertj.core.api.Assertions.assertThat;
+
+class QuarkusPlatformMixinTest {
+
+ private static final QuarkusPlatformMixinSpec DEFAULT_FALLBACK = new
QuarkusPlatformMixinSpec() {
+ @Override
+ public String quarkusGroupId() {
+ return "io.quarkus.platform";
+ }
+
+ @Override
+ public String quarkusVersion() {
+ return null;
+ }
+
+ @Override
+ public String quarkusExtensionRegistryBaseUri() {
+ return RuntimeType.QUARKUS_EXTENSION_REGISTRY_BASE_URL;
+ }
+ };
+
+ @Test
+ void platformUrlFromPropertiesIsHonoured() {
+ Properties props = new Properties();
+ props.setProperty(QuarkusHelper.QUARKUS_PLATFORM_URL_PROPERTY,
"https://my.registry.example.com");
+
+ QuarkusPlatformMixin result = QuarkusPlatformMixin.of(props,
DEFAULT_FALLBACK);
+
+
assertThat(result.quarkusExtensionRegistryBaseUri()).isEqualTo("https://my.registry.example.com");
+ }
+
+ @Test
+ void platformUrlSuffixStrippedWhenReadFromProperties() {
+ Properties props = new Properties();
+ props.setProperty(QuarkusHelper.QUARKUS_PLATFORM_URL_PROPERTY,
+ "https://my.registry.example.com/client/platforms");
+
+ QuarkusPlatformMixin result = QuarkusPlatformMixin.of(props,
DEFAULT_FALLBACK);
+
+
assertThat(result.quarkusExtensionRegistryBaseUri()).isEqualTo("https://my.registry.example.com");
+ }
+
+ @Test
+ void platformUrlTrailingSlashIsStripped() {
+ Properties props = new Properties();
+ props.setProperty(QuarkusHelper.QUARKUS_PLATFORM_URL_PROPERTY,
"https://my.registry.example.com/");
+
+ QuarkusPlatformMixin result = QuarkusPlatformMixin.of(props,
DEFAULT_FALLBACK);
+
+
assertThat(result.quarkusExtensionRegistryBaseUri()).isEqualTo("https://my.registry.example.com");
+ }
+
+ @Test
+ void canonicalKeyTakesPriorityOverLegacyKey() {
+ Properties props = new Properties();
+ props.setProperty(QUARKUS_EXTENSION_REGISTRY_BASE_URI,
"https://canonical.example.com");
+ props.setProperty(QuarkusHelper.QUARKUS_PLATFORM_URL_PROPERTY,
"https://legacy.example.com");
+
+ QuarkusPlatformMixin result = QuarkusPlatformMixin.of(props,
DEFAULT_FALLBACK);
+
+
assertThat(result.quarkusExtensionRegistryBaseUri()).isEqualTo("https://canonical.example.com");
+ }
+
+ @Test
+ void fallbackUsedWhenNeitherPropertyIsSet() {
+ QuarkusPlatformMixin result = QuarkusPlatformMixin.of(new
Properties(), DEFAULT_FALLBACK);
+
+ assertThat(result.quarkusExtensionRegistryBaseUri())
+ .isEqualTo(RuntimeType.QUARKUS_EXTENSION_REGISTRY_BASE_URL);
+ }
+
+ @Test
+ void twoPhaseLoadingPreservesFirstValue() {
+ Properties appProps = new Properties();
+ appProps.setProperty(QuarkusHelper.QUARKUS_PLATFORM_URL_PROPERTY,
"https://from-app-props.example.com");
+ QuarkusPlatformMixin afterPhase1 = QuarkusPlatformMixin.of(appProps,
DEFAULT_FALLBACK);
+
+ QuarkusPlatformMixin afterPhase2 = QuarkusPlatformMixin.of(new
Properties(), afterPhase1);
+
+
assertThat(afterPhase2.quarkusExtensionRegistryBaseUri()).isEqualTo("https://from-app-props.example.com");
+ }
+
+ @Test
+ void twoPhaseLoadingAllowsOverride() {
+ Properties appProps = new Properties();
+ appProps.setProperty(QuarkusHelper.QUARKUS_PLATFORM_URL_PROPERTY,
"https://from-app-props.example.com");
+ QuarkusPlatformMixin afterPhase1 = QuarkusPlatformMixin.of(appProps,
DEFAULT_FALLBACK);
+
+ Properties sysProps = new Properties();
+ sysProps.setProperty(QuarkusHelper.QUARKUS_PLATFORM_URL_PROPERTY,
"https://from-sys-prop.example.com");
+ QuarkusPlatformMixin afterPhase2 = QuarkusPlatformMixin.of(sysProps,
afterPhase1);
+
+
assertThat(afterPhase2.quarkusExtensionRegistryBaseUri()).isEqualTo("https://from-sys-prop.example.com");
+ }
+
+}