Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle plugin: use full URI for configuration source locations #36803

Merged
merged 1 commit into from
Nov 2, 2023

Conversation

snazy
Copy link
Contributor

@snazy snazy commented Oct 31, 2023

io.quarkus.gradle.tasks.EffectiveConfig.CombinedConfigSourceProvider passes only the "file extension" (e.g. application.properties) down to io.smallrye.config.AbstractLocationConfigSourceLoader#loadConfigSources(java.lang.String[], int, java.lang.ClassLoader), which may let that function behave wrong and try to for example access an application.properties in the wrong location. This can be reproduced by placing an application.properties file in the project directory of a Gradle project that uses the Quarkus Gradle plugin.

This change fixes this behavior by passing down the correct locations as the String representation of the resource URIs, instead of just the "file extensions".

Fixes #36767

`io.quarkus.gradle.tasks.EffectiveConfig.CombinedConfigSourceProvider` passes only the "file extension" (e.g. `application.properties`) down to `io.smallrye.config.AbstractLocationConfigSourceLoader#loadConfigSources(java.lang.String[], int, java.lang.ClassLoader)`, which may let that function behave wrong and try to for example access an `application.properties` in the wrong location. This can be reproduced by placing an `application.properties` file in the project directory of a Gradle project that uses the Quarkus Gradle plugin.

This change fixes this behavior by passing down the correct locations as the `String` representation of the resource URIs, instead of just the "file extensions".

Fixes quarkusio#36767
@quarkus-bot quarkus-bot bot added area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle labels Oct 31, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 31, 2023

✔️ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Copy link
Member

@radcortez radcortez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! Thanks :)

@radcortez radcortez merged commit 6932a4c into quarkusio:main Nov 2, 2023
20 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.6 - main milestone Nov 2, 2023
@gsmet gsmet modified the milestones: 3.6 - main, 3.5.1 Nov 6, 2023
@snazy snazy deleted the appl-props-in-root branch November 6, 2023 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/devtools Issues/PR related to maven, gradle, platform and cli tooling/plugins area/gradle Gradle kind/bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gradle build does not work when an "application.properties" exists at the root of the project
3 participants