Repository: quarkusio/quarkus
Issue: Config value evaluation failing when the placeholder value is missing

### Describe the bug

In an application using kubernetes-config, I have a prod profile with the following configuration:

```
%prod.quarkus.kubernetes-config.secrets=postgresql
%prod.quarkus.kubernetes-config.secrets.enabled=true
%prod.quarkus.datasource.db-kind=postgresql
%prod.quarkus.datasource.username=${database-user}
%prod.quarkus.datasource.password=${database-password}
%prod.quarkus.datasource.jdbc.url=jdbc:postgresql://postgresql:5432/person
```


The database-user and database-password are provided by a Kubernetes secret at runtime.
However, a simple `mvn package` throws:

```
java.util.NoSuchElementException: SRCFG00011: Could not expand value database-user in property quarkus.datasource.username
	at io.smallrye.config.ExpressionConfigSourceInterceptor.lambda$getValue$0(ExpressionConfigSourceInterceptor.java:63)
	at io.smallrye.common.expression.ExpressionNode.emit(ExpressionNode.java:22)
	at io.smallrye.common.expression.Expression.evaluateException(Expression.java:56)
	at io.smallrye.common.expression.Expression.evaluate(Expression.java:70)
	at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:56)
	at io.smallrye.config.ExpressionConfigSourceInterceptor.getValue(ExpressionConfigSourceInterceptor.java:36)
	at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
	at io.smallrye.config.PropertyNamesConfigSourceInterceptor.getValue(PropertyNamesConfigSourceInterceptor.java:61)
	at io.smallrye.config.SmallRyeConfigSourceInterceptorContext.proceed(SmallRyeConfigSourceInterceptorContext.java:20)
	at io.smallrye.config.SmallRyeConfig.getConfigValue(SmallRyeConfig.java:307)
	at io.smallrye.config.SmallRyeConfig.getValue(SmallRyeConfig.java:225)
	at io.smallrye.config.SmallRyeConfig.getOptionalValue(SmallRyeConfig.java:324)
	at io.quarkus.hibernate.orm.deployment.HibernateOrmProcessor.devServicesAutoGenerateByDefault(HibernateOrmProcessor.java:199)
```

### Expected behavior

It should not fail.

### Actual behavior

It fails since 2.3.0.

### How to Reproduce?

Clone https://github.com/cescoffier/devnation-quarkus-movies and update the quarkus version to 999-SNAPSHOT (it fails since 2.3.0.Final), and run `mvn package -DskipTests`. You can revert to the original version to see the build succeeds. 

### Output of `uname -a` or `ver`

_No response_

### Output of `java -version`

_No response_

### GraalVM version (if different from Java)

_No response_

### Quarkus version or git rev

_No response_

### Build tool (ie. output of `mvnw --version` or `gradlew --version`)

_No response_

### Additional information

_No response_

Changed files:
extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java

diff --git a/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java b/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java
index 5a9f8b5863b..7590089a743 100644
--- a/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java
+++ b/extensions/hibernate-orm/deployment/src/main/java/io/quarkus/hibernate/orm/deployment/HibernateOrmProcessor.java
@@ -41,7 +41,6 @@
 import javax.persistence.spi.PersistenceUnitTransactionType;
 import javax.transaction.TransactionManager;
 
-import org.eclipse.microprofile.config.ConfigProvider;
 import org.hibernate.MultiTenancyStrategy;
 import org.hibernate.boot.archive.scan.spi.ClassDescriptor;
 import org.hibernate.boot.archive.scan.spi.PackageDescriptor;
@@ -130,6 +129,7 @@
 import io.quarkus.panache.common.deployment.HibernateEnhancersRegisteredBuildItem;
 import io.quarkus.panache.common.deployment.HibernateModelClassCandidatesForFieldAccessBuildItem;
 import io.quarkus.runtime.LaunchMode;
+import io.quarkus.runtime.configuration.ConfigUtils;
 import io.quarkus.runtime.configuration.ConfigurationException;
 import net.bytebuddy.description.type.TypeDescription;
 import net.bytebuddy.dynamic.DynamicType;
@@ -196,10 +196,9 @@ void devServicesAutoGenerateByDefault(DevServicesLauncherConfigResultBuildItem d
             dsName = "quarkus.datasource." + config.defaultPersistenceUnit.datasource.get() + ".username";
         }
 
-        if (ConfigProvider.getConfig().getOptionalValue(dsName, String.class).isEmpty()) {
+        if (!ConfigUtils.isPropertyPresent(dsName)) {
             if (devServicesResult.getConfig().containsKey(dsName)) {
-                if (ConfigProvider.getConfig().getOptionalValue("quarkus.hibernate-orm.database.generation", String.class)
-                        .isEmpty()) {
+                if (!ConfigUtils.isPropertyPresent("quarkus.hibernate-orm.database.generation")) {
                     LOG.info(
                             "Setting quarkus.hibernate-orm.database.generation=drop-and-create to initialize Dev Services managed database");
                     runTimeConfigurationDefaultBuildItemBuildProducer.produce(new RunTimeConfigurationDefaultBuildItem(
@@ -215,10 +214,10 @@ void devServicesAutoGenerateByDefault(DevServicesLauncherConfigResultBuildItem d
             } else {
                 dsName = "quarkus.datasource." + entry.getValue().datasource.get() + ".username";
             }
-            if (ConfigProvider.getConfig().getOptionalValue(dsName, String.class).isEmpty()) {
+            if (!ConfigUtils.isPropertyPresent(dsName)) {
                 if (devServicesResult.getConfig().containsKey(dsName)) {
                     String propertyName = "quarkus.hibernate-orm." + entry.getKey() + ".database.generation";
-                    if (ConfigProvider.getConfig().getOptionalValue(propertyName, String.class).isEmpty()) {
+                    if (!ConfigUtils.isPropertyPresent(propertyName)) {
                         LOG.info("Setting " + propertyName + "=drop-and-create to initialize Dev Services managed database");
                         runTimeConfigurationDefaultBuildItemBuildProducer
                                 .produce(new RunTimeConfigurationDefaultBuildItem(propertyName, "drop-and-create"));
@@ -1506,4 +1505,4 @@ static final class CachedProxy {
             this.interfaces = interfaces;
         }
     }
-}
\\ No newline at end of file
+}