diff --git a/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ExcludeConfigBuildItem.java b/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ExcludeConfigBuildItem.java index fc6e88f8116f8..8c2cf955c2639 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ExcludeConfigBuildItem.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/builditem/nativeimage/ExcludeConfigBuildItem.java @@ -28,7 +28,7 @@ public ExcludeConfigBuildItem(String jarFile, String resourceName) { } public ExcludeConfigBuildItem(String jarFile) { - this(jarFile, "META-INF/native-image/native-image.properties"); + this(jarFile, "/META-INF/native-image/native-image\\.properties"); } public String getJarFile() { diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java index e1dba7ed6f7e9..2236dd642d26b 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java @@ -595,8 +595,6 @@ public NativeImageInvokerInfo build() { "-H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime"); //the default collection policy results in full GC's 50% of the time nativeImageArgs.add("-H:+JNI"); nativeImageArgs.add("-H:+AllowFoldMethods"); - nativeImageArgs.add("-jar"); - nativeImageArgs.add(runnerJarName); if (nativeConfig.enableFallbackImages) { nativeImageArgs.add("-H:FallbackThreshold=5"); @@ -722,6 +720,10 @@ public NativeImageInvokerInfo build() { nativeImageArgs.add(nativeImageName); + //Make sure to have the -jar as last one, as it otherwise breaks "--exclude-config" + nativeImageArgs.add("-jar"); + nativeImageArgs.add(runnerJarName); + return new NativeImageInvokerInfo(nativeImageArgs); }