-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 builds include values from .env, which override defaults in application.properties, outlasting non-clean rebuilds. #34869
Labels
Milestone
Comments
/cc @evanchooly (kotlin), @geoand (kotlin), @glefloch, @quarkusio/devtools |
@snazy I wonder if it's an issue specific to Gradle or if it's something that is config-related. Any clue? |
It's probably the new mechanism to fetch the config. Let me take a look. |
snazy
added a commit
to snazy/quarkus
that referenced
this issue
Jul 25, 2023
…erties Currently the Gradle plugin considers only system properties starting with `quarkus.` (and env vars starting with `QUARKUS_`) as relevant for Gradle's cache key. This is on purpose to not cause unnecessary rebuilds, because especially system properties can contain entries that are rather "random-ish". But other environment variables or system properties cannot be specified as "relevant". This change introduces a new list-property `cachingRelevantProperties` on the Quarkus Gradle extension object to tell the Quarkus Gradle plugin to consider the specified properties/env-vars as input(s) for the tasks. This list-property accepts regex patterns, and by default contains `quarkus[.].*`, matching the current `.startsWith("quarkus.")`. Fixes quarkusio#34869
snazy
added a commit
to snazy/quarkus
that referenced
this issue
Jul 25, 2023
…erties Currently the Gradle plugin considers only system properties starting with `quarkus.` (and env vars starting with `QUARKUS_`) as relevant for Gradle's cache key. This is on purpose to not cause unnecessary rebuilds, because especially system properties can contain entries that are rather "random-ish". But other environment variables or system properties cannot be specified as "relevant". This change introduces a new list-property `cachingRelevantProperties` on the Quarkus Gradle extension object to tell the Quarkus Gradle plugin to consider the specified properties/env-vars as input(s) for the tasks. This list-property accepts regex patterns, and by default contains `quarkus[.].*`, matching the current `.startsWith("quarkus.")`. Fixes quarkusio#34869
snazy
added a commit
to snazy/quarkus
that referenced
this issue
Jul 25, 2023
…erties Currently the Gradle plugin considers only system properties starting with `quarkus.` (and env vars starting with `QUARKUS_`) as relevant for Gradle's cache key. This is on purpose to not cause unnecessary rebuilds, because especially system properties can contain entries that are rather "random-ish". But other environment variables or system properties cannot be specified as "relevant". This change introduces a new list-property `cachingRelevantProperties` on the Quarkus Gradle extension object to tell the Quarkus Gradle plugin to consider the specified properties/env-vars as input(s) for the tasks. This list-property accepts regex patterns, and by default contains `quarkus[.].*`, matching the current `.startsWith("quarkus.")`. Fixes quarkusio#34869
snazy
added a commit
to snazy/quarkus
that referenced
this issue
Jul 26, 2023
…erties Currently the Gradle plugin considers only system properties starting with `quarkus.` (and env vars starting with `QUARKUS_`) as relevant for Gradle's cache key. This is on purpose to not cause unnecessary rebuilds, because especially system properties can contain entries that are rather "random-ish". But other environment variables or system properties cannot be specified as "relevant". This change introduces a new list-property `cachingRelevantProperties` on the Quarkus Gradle extension object to tell the Quarkus Gradle plugin to consider the specified properties/env-vars as input(s) for the tasks. This list-property accepts regex patterns, and by default contains `quarkus[.].*`, matching the current `.startsWith("quarkus.")`. Fixes quarkusio#34869
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Aug 26, 2023
…erties Currently the Gradle plugin considers only system properties starting with `quarkus.` (and env vars starting with `QUARKUS_`) as relevant for Gradle's cache key. This is on purpose to not cause unnecessary rebuilds, because especially system properties can contain entries that are rather "random-ish". But other environment variables or system properties cannot be specified as "relevant". This change introduces a new list-property `cachingRelevantProperties` on the Quarkus Gradle extension object to tell the Quarkus Gradle plugin to consider the specified properties/env-vars as input(s) for the tasks. This list-property accepts regex patterns, and by default contains `quarkus[.].*`, matching the current `.startsWith("quarkus.")`. Fixes quarkusio#34869 (cherry picked from commit 44b76fa)
gsmet
pushed a commit
to gsmet/quarkus
that referenced
this issue
Aug 26, 2023
…erties Currently the Gradle plugin considers only system properties starting with `quarkus.` (and env vars starting with `QUARKUS_`) as relevant for Gradle's cache key. This is on purpose to not cause unnecessary rebuilds, because especially system properties can contain entries that are rather "random-ish". But other environment variables or system properties cannot be specified as "relevant". This change introduces a new list-property `cachingRelevantProperties` on the Quarkus Gradle extension object to tell the Quarkus Gradle plugin to consider the specified properties/env-vars as input(s) for the tasks. This list-property accepts regex patterns, and by default contains `quarkus[.].*`, matching the current `.startsWith("quarkus.")`. Fixes quarkusio#34869 (cherry picked from commit 44b76fa)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Consider having an
application.properties
file like this:...and a
.env
file like this:Expected behavior
Building the project while having the
.env
file in its root directory doesn't affect the default value provided inapplication.properties
. Actually, it shouldn't affect the build output at all.Regarding the example project, its endpoint should return "Hello!", unless there is an
.env
file with a value overriding it in its working directory,Actual behavior
A clean build uses the value from
.env
as default. Subsequent builds keep that value even if.env
is updated. After cleaning and rebuilding, the updated value from.env
is used.How to Reproduce?
An example project using Gradle (Kotlin) with a ConfigMapping and a RESTEasy endpoint returning
greeting.message
is provided.Build, copy build output to a another directory and cd into it (to get the .env file out of the way), run, check output, modify, repeat, clean, repeat... as necessary to reproduce the described actual behavior.
quarkus-dotenv.tar.gz
Output of
uname -a
orver
Linux ***** 6.4.3-arch1-2 #1 SMP PREEMPT_DYNAMIC Sat, 15 Jul 2023 19:25:49 +0000 x86_64 GNU/Linux
Output of
java -version
openjdk version "17.0.7" 2023-04-18 OpenJDK Runtime Environment GraalVM CE 17.0.7+7.1 (build 17.0.7+7-jvmci-23.0-b12) OpenJDK 64-Bit Server VM GraalVM CE 17.0.7+7.1 (build 17.0.7+7-jvmci-23.0-b12, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.2.1.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 8.1.1
Additional information
Bug was introduced sometime between 2.6.x and 3.2.0.
The text was updated successfully, but these errors were encountered: