-
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
quarkus.profile is fixed at build time while it is documented as runtime #28176
Comments
There are two profiles, one used at build time and one used at run time. The profile used at build time is also the profile that is used as the default at runtime if no profile is specified explicitly. |
@mschorsch that is what I thought too, but when I start my app with a runtime profile the message in the log is still "quarkus started with profile prod", and I don't think it is a display issue because my custom config in the uat profile is not applied. |
I've tried a simple project, and it seems to work as expected: java -Dquarkus.profile=x -jar target/quarkus-app/quarkus-run.jar
__ ____ __ _____ ___ __ ____ ______
--/ __ \/ / / / _ | / _ \/ //_/ / / / __/
-/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2022-09-26 18:04:13 INFO [io.qua.sma.ope.run.OpenApiRecorder]] (main) Default CORS properties will be used, please use 'quarkus.http.cors' properties instead
2022-09-26 18:04:13 INFO [io.quarkus]] (main) number-api 1.0-SNAPSHOT on JVM (powered by Quarkus 2.12.3.Final) started in 0.979s. Listening on: http://0.0.0.0:8090
2022-09-26 18:04:13 INFO [io.quarkus]] (main) Profile x activated. and java -Dquarkus.profile=y -jar target/quarkus-app/quarkus-run.jar
__ ____ __ _____ ___ __ ____ ______
--/ __ \/ / / / _ | / _ \/ //_/ / / / __/
-/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2022-09-26 18:04:54 INFO [io.qua.sma.ope.run.OpenApiRecorder]] (main) Default CORS properties will be used, please use 'quarkus.http.cors' properties instead
2022-09-26 18:04:54 INFO [io.quarkus]] (main) number-api 1.0-SNAPSHOT on JVM (powered by Quarkus 2.12.3.Final) started in 0.992s. Listening on: http://0.0.0.0:8090
2022-09-26 18:04:54 INFO [io.quarkus]] (main) Profile y activated. Are you able to provide additional steps or even a reproducer? Maybe you have your profile in a higher ordinal source? |
@radcortez I set it in the config/application.yml main section, is it mandatory to pass it as property ? if I try to display quarkus.profile config property by injecting it somewhere, the value is uat as expected, however the startup message is still "2022-09-26 14:15:35,039 INFO [io.quarkus] (main) Profile prod activated." |
Yes, at the moment, This should be fixed by #28091. Until then, please set |
@radcortez thanks a lot, should I close it for now ? Maybe this worth a note in the doc ? |
You can leave it open so I can make some adjustments to #28091. |
Describe the bug
quarkus profile cannot be changed at runtime. It always stick to the value configured at build time.
I don't know if this is expected or not,
but in the documentation, it is documented as a runtime value (without the lock).
Also I think it should be a good thing to be able to set the profile at runtime (while I understand this would only affect runtime config values, and the profile used during the build would affect build time values)
Verified on 2.12.3.Final;
The text was updated successfully, but these errors were encountered: