From 2ead51598f77a48bc760481005ffefe919c0d7d9 Mon Sep 17 00:00:00 2001 From: glefloch Date: Fri, 20 Jan 2023 17:46:11 +0100 Subject: [PATCH] Limit application.properties lookup to main source set --- .../src/main/java/io/quarkus/gradle/tasks/QuarkusBuild.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuild.java b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuild.java index 5013ce21a6693..4d98e2e99a3d8 100644 --- a/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuild.java +++ b/devtools/gradle/gradle-application-plugin/src/main/java/io/quarkus/gradle/tasks/QuarkusBuild.java @@ -235,9 +235,11 @@ private String expandConfigurationKey(String shortKey) { private String getPropValueWithPrecedence(final String propName, final java.util.Optional defaultValue) { if (applicationProperties.isEmpty()) { - FileCollection classpathFiles = getClasspath() + SourceSet mainSourceSet = QuarkusGradleUtils.getSourceSet(getProject(), SourceSet.MAIN_SOURCE_SET_NAME); + + FileCollection configFiles = mainSourceSet.getResources() .filter(file -> "application.properties".equalsIgnoreCase(file.getName())); - classpathFiles.forEach(file -> { + configFiles.forEach(file -> { FileInputStream appPropsIS = null; try { appPropsIS = new FileInputStream(file.getAbsoluteFile());