diff --git a/core/deployment/src/main/java/io/quarkus/deployment/steps/ConfigBuildSteps.java b/core/deployment/src/main/java/io/quarkus/deployment/steps/ConfigBuildSteps.java index 478b4b9d13ff4..975071dad0eb1 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/steps/ConfigBuildSteps.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/steps/ConfigBuildSteps.java @@ -15,6 +15,7 @@ import io.quarkus.deployment.builditem.StaticInitConfigBuilderBuildItem; import io.quarkus.deployment.builditem.nativeimage.RuntimeInitializedClassBuildItem; import io.quarkus.deployment.builditem.nativeimage.ServiceProviderBuildItem; +import io.quarkus.deployment.pkg.steps.NativeOrNativeSourcesBuild; import io.quarkus.deployment.util.ServiceUtil; import io.quarkus.runtime.configuration.SystemOnlySourcesConfigBuilder; import io.quarkus.runtime.graal.InetRunTime; @@ -62,6 +63,16 @@ void systemOnlySources(BuildProducer staticIni runTimeConfigBuilder.produce(new RunTimeConfigBuilderBuildItem(SystemOnlySourcesConfigBuilder.class.getName())); } + /** + * Disable external configuration sources parsing for native executables since they are not supported see + * https://github.com/quarkusio/quarkus/issues/41994 + */ + @BuildStep(onlyIf = NativeOrNativeSourcesBuild.class) + void nativeNoSources(BuildProducer staticInitConfigBuilder, + BuildProducer runTimeConfigBuilder) { + runTimeConfigBuilder.produce(new RunTimeConfigBuilderBuildItem(SystemOnlySourcesConfigBuilder.class.getName())); + } + private static class SystemOnlySources implements BooleanSupplier { ConfigBuildTimeConfig configBuildTimeConfig;