From 3ec51d1c4dc476fbc226052e8cad0173bfeaf5c1 Mon Sep 17 00:00:00 2001 From: Peter Zaoral Date: Mon, 13 May 2024 08:47:38 +0200 Subject: [PATCH] quarkus-next: Replace deprecated QUARKUS_PROFILE_PROP constant (#29439) Closes: #29438 Signed-off-by: Peter Zaoral --- .../org/keycloak/quarkus/deployment/KeycloakProcessor.java | 4 ++-- .../main/java/org/keycloak/quarkus/runtime/Environment.java | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/KeycloakProcessor.java b/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/KeycloakProcessor.java index fd72e0bbe6..cb39a811ac 100644 --- a/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/KeycloakProcessor.java +++ b/quarkus/deployment/src/main/java/org/keycloak/quarkus/deployment/KeycloakProcessor.java @@ -43,8 +43,8 @@ import io.quarkus.hibernate.orm.deployment.PersistenceXmlDescriptorBuildItem; import io.quarkus.hibernate.orm.deployment.integration.HibernateOrmIntegrationRuntimeConfiguredBuildItem; import io.quarkus.hibernate.orm.deployment.spi.AdditionalJpaModelBuildItem; import io.quarkus.resteasy.reactive.server.spi.MethodScannerBuildItem; +import io.quarkus.runtime.LaunchMode; import io.quarkus.runtime.configuration.ConfigurationException; -import io.quarkus.runtime.configuration.ProfileManager; import io.quarkus.vertx.http.deployment.NonApplicationRootPathBuildItem; import io.quarkus.vertx.http.deployment.RouteBuildItem; import io.smallrye.config.ConfigValue; @@ -545,7 +545,7 @@ class KeycloakProcessor { if (profile != null) { properties.put(Environment.PROFILE, profile); - properties.put(ProfileManager.QUARKUS_PROFILE_PROP, profile); + properties.put(LaunchMode.current().getProfileKey(), profile); } properties.put(QUARKUS_PROPERTY_ENABLED, String.valueOf(QuarkusPropertiesConfigSource.getConfigurationFile() != null)); diff --git a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/Environment.java b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/Environment.java index bcc62354ee..0ad19dadf6 100644 --- a/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/Environment.java +++ b/quarkus/runtime/src/main/java/org/keycloak/quarkus/runtime/Environment.java @@ -31,7 +31,6 @@ import java.util.function.Function; import java.util.stream.Collectors; import io.quarkus.runtime.LaunchMode; -import io.quarkus.runtime.configuration.ProfileManager; import io.smallrye.config.SmallRyeConfig; import org.apache.commons.lang3.SystemUtils; @@ -116,7 +115,7 @@ public final class Environment { public static void setProfile(String profile) { System.setProperty(PROFILE, profile); - System.setProperty(ProfileManager.QUARKUS_PROFILE_PROP, profile); + System.setProperty(LaunchMode.current().getProfileKey(), profile); System.setProperty(SmallRyeConfig.SMALLRYE_CONFIG_PROFILE, profile); if (isTestLaunchMode()) { System.setProperty("mp.config.profile", profile);