Repository: quarkusio/quarkus
Issue: quarkus.config.locations was 'null' at build time and is now '/mnt/app-config-map'

### Describe the bug

As a workaround for https://github.com/quarkusio/quarkus/issues/20830, I've added the following entries to my pom.xml:

```xml
<!-- secrets -->
<quarkus.kubernetes.secret-volumes.app-secret.secret-name>my-secret</quarkus.kubernetes.secret-volumes.app-secret.secret-name>
<quarkus.kubernetes.mounts.app-secret.path>/mnt/app-secret</quarkus.kubernetes.mounts.app-secret.path>
<quarkus.kubernetes.env.vars.SMALLRYE_CONFIG_SOURCE_FILE_LOCATIONS>/mnt/app-secret</quarkus.kubernetes.env.vars.SMALLRYE_CONFIG_SOURCE_FILE_LOCATIONS>

<!-- config map -->
<quarkus.kubernetes.app-config-map>my-config</quarkus.kubernetes.app-config-map>
```

Which the `quarkus-kubernetes` extension turn into the following env var and volumes in the generated `kubernetete.yaml` file:

```yaml
apiVersion: "apps/v1"
kind: "Deployment"
spec:
    spec:
      containers:
      - env:
        - name: "KUBERNETES_NAMESPACE"
          valueFrom:
            fieldRef:
              fieldPath: "metadata.namespace"
        - name: "SMALLRYE_CONFIG_SOURCE_FILE_LOCATIONS"
          value: "/mnt/app-secret"
        - name: "SMALLRYE_CONFIG_LOCATIONS"
          value: "/mnt/app-config"
      volumes:
      - name: "app-secret"
        secret:
          secretName: "my-secret"
      - name: "app-config"
        configMap:
          name: "my-config"        
```

When the pods starts, a warning appears:

```
WARN  [io.quarkus.runtime.configuration.ConfigRecorder] (main) Build time property cannot be changed at runtime: quarkus.config.locations was 'null' at build time and is now '/mnt/app-config'
```

### Expected behavior

The warning should not appear

### Actual behavior

The warning appear

### How to Reproduce?

- create a project with quarkus-kubernetes as described in https://quarkus.io/guides/deploying-to-kubernetes (but using 2.4.0.CR1 as platfomr version)
- add the maven properties as described to the generated pom
- ./mvnw package
- export SMALLRYE_CONFIG_SOURCE_FILE_LOCATIONS=/tmp
- export SMALLRYE_CONFIG_LOCATIONS=/tmp
- java -jar target/quarkus-app/quarkus-run.jar

### Output of `uname -a` or `ver`

Linux moon 5.14.10-300.fc35.x86_64 #1 SMP Thu Oct 7 20:48:44 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

### Output of `java -version`

openjdk version "11.0.12" 2021-07-20
OpenJDK Runtime Environment 18.9 (build 11.0.12+7)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.12+7, mixed mode, sharing)


### GraalVM version (if different from Java)

_No response_

### Quarkus version or git rev

2.4.0.Final

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

Apache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d)
Maven home: /home/luca/.m2/wrapper/dists/apache-maven-3.8.1-bin/2l5mhf2pq2clrde7f7qp1rdt5m/apache-maven-3.8.1
Java version: 11.0.12, vendor: Red Hat, Inc., runtime: /usr/lib/jvm/java-11-openjdk-11.0.12.0.7-4.fc35.x86_64
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "5.14.10-300.fc35.x86_64", arch: "amd64", family: "unix"


### Additional information

_No response_

Changed files:
core/runtime/src/main/java/io/quarkus/runtime/ConfigConfig.java, core/deployment/src/main/java/io/quarkus/deployment/steps/DevModeBuildStep.java, core/deployment/src/main/java/io/quarkus/deployment/steps/ProfileBuildStep.java

diff --git a/core/deployment/src/main/java/io/quarkus/deployment/steps/DevModeBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/steps/DevModeBuildStep.java
index a896fd845ef..ebdaed9d9b0 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/steps/DevModeBuildStep.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/steps/DevModeBuildStep.java
@@ -1,24 +1,30 @@
 package io.quarkus.deployment.steps;
 
+import static io.smallrye.config.SmallRyeConfig.SMALLRYE_CONFIG_LOCATIONS;
+
 import java.nio.file.Paths;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Optional;
 import java.util.stream.Collectors;
 
+import org.eclipse.microprofile.config.ConfigProvider;
+
 import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.builditem.HotDeploymentWatchedFileBuildItem;
-import io.quarkus.runtime.ConfigConfig;
 import io.quarkus.runtime.LiveReloadConfig;
 
 class DevModeBuildStep {
 
     @BuildStep
-    List<HotDeploymentWatchedFileBuildItem> watchChanges(ConfigConfig config, LiveReloadConfig liveReloadConfig) {
+    List<HotDeploymentWatchedFileBuildItem> watchChanges(LiveReloadConfig liveReloadConfig) {
         List<String> names = new ArrayList<>();
         names.add("META-INF/microprofile-config.properties");
         names.add("application.properties");
         names.add(Paths.get(".env").toAbsolutePath().toString());
-        config.locations.ifPresent(names::addAll);
+        Optional<List<String>> locations = ConfigProvider.getConfig().getOptionalValues(SMALLRYE_CONFIG_LOCATIONS,
+                String.class);
+        locations.ifPresent(names::addAll);
         liveReloadConfig.watchedResources.ifPresent(names::addAll);
         return names.stream().map(HotDeploymentWatchedFileBuildItem::new).collect(Collectors.toList());
     }
diff --git a/core/deployment/src/main/java/io/quarkus/deployment/steps/ProfileBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/steps/ProfileBuildStep.java
index 79339c9d9ec..20400b34fb2 100644
--- a/core/deployment/src/main/java/io/quarkus/deployment/steps/ProfileBuildStep.java
+++ b/core/deployment/src/main/java/io/quarkus/deployment/steps/ProfileBuildStep.java
@@ -1,15 +1,19 @@
 package io.quarkus.deployment.steps;
 
+import static io.smallrye.config.SmallRyeConfig.SMALLRYE_CONFIG_LOCATIONS;
+
 import java.nio.file.Paths;
+import java.util.List;
+import java.util.Optional;
 
 import org.apache.commons.io.FilenameUtils;
+import org.eclipse.microprofile.config.ConfigProvider;
 
 import io.quarkus.deployment.annotations.BuildProducer;
 import io.quarkus.deployment.annotations.BuildStep;
 import io.quarkus.deployment.builditem.HotDeploymentWatchedFileBuildItem;
 import io.quarkus.deployment.builditem.LaunchModeBuildItem;
 import io.quarkus.deployment.builditem.RunTimeConfigurationDefaultBuildItem;
-import io.quarkus.runtime.ConfigConfig;
 import io.quarkus.runtime.LaunchMode;
 
 public class ProfileBuildStep {
@@ -22,7 +26,6 @@ RunTimeConfigurationDefaultBuildItem defaultProfile(LaunchModeBuildItem launchMo
 
     @BuildStep
     void watchProfileSpecificFile(LaunchModeBuildItem launchModeBuildItem,
-            ConfigConfig config,
             BuildProducer<HotDeploymentWatchedFileBuildItem> items) {
         String activeProfile = getProfileValue(launchModeBuildItem.getLaunchMode());
         String suffixedApplicationProperties = String.format("application-%s.properties", activeProfile);
@@ -31,8 +34,10 @@ void watchProfileSpecificFile(LaunchModeBuildItem launchModeBuildItem,
                 Paths.get(String.format(".env-%s", activeProfile)).toAbsolutePath().toString()));
         items.produce(new HotDeploymentWatchedFileBuildItem(Paths
                 .get(System.getProperty("user.dir"), "config", suffixedApplicationProperties).toAbsolutePath().toString()));
-        if (config.locations.isPresent()) {
-            for (String location : config.locations.get()) {
+        Optional<List<String>> locations = ConfigProvider.getConfig().getOptionalValues(SMALLRYE_CONFIG_LOCATIONS,
+                String.class);
+        if (locations.isPresent()) {
+            for (String location : locations.get()) {
                 items.produce(new HotDeploymentWatchedFileBuildItem(appendProfileToFilename(location, activeProfile)));
             }
         }
diff --git a/core/runtime/src/main/java/io/quarkus/runtime/ConfigConfig.java b/core/runtime/src/main/java/io/quarkus/runtime/ConfigConfig.java
index 6ebbd950821..1eca98398de 100644
--- a/core/runtime/src/main/java/io/quarkus/runtime/ConfigConfig.java
+++ b/core/runtime/src/main/java/io/quarkus/runtime/ConfigConfig.java
@@ -14,7 +14,7 @@
  * Relocation of the Config configurations to the Quarkus namespace is done in
  * {@link io.quarkus.runtime.configuration.ConfigUtils#configBuilder}.
  */
-@ConfigRoot(name = ConfigItem.PARENT, phase = ConfigPhase.BUILD_AND_RUN_TIME_FIXED)
+@ConfigRoot(name = ConfigItem.PARENT, phase = ConfigPhase.RUN_TIME)
 public class ConfigConfig {
     /**
      * Additional config locations to be loaded with the Config. The configuration support multiple locations