Skip to content

Commit

Permalink
Limit application.properties lookup to main source set
Browse files Browse the repository at this point in the history
  • Loading branch information
glefloch authored and ebullient committed Jan 24, 2023
1 parent 9974742 commit 9772722
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,11 @@ private String expandConfigurationKey(String shortKey) {

private String getPropValueWithPrecedence(final String propName, final java.util.Optional<String> 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());
Expand Down

0 comments on commit 9772722

Please sign in to comment.