-
Build application command:
mvn clean package
-
Run java jar with profile NONE-CI activated
java -Dquarkus.profile=NONE-CI -jar target\nativeconfig-1.0.0-SNAPSHOT-runner.jar
-
Verify application console output - it should be following (this is expected and valid behaviour):
2022-03-14 16:50:37,388 INFO [io.quarkus] (main) nativeconfig 1.0.0-SNAPSHOT on JVM (powered by Quarkus 2.5.0.Final) started in 4.791s. Listening on: http://0.0.0.0:8480
2022-03-14 16:50:37,403 INFO [io.quarkus] (main) Profile NONE-CI activated.
2022-03-14 16:50:37,407 INFO [io.quarkus] (main) Installed features: [cdi, config-yaml, resteasy, servlet, smallrye-context-propagation, vertx]
Read value [ Optional[CI]] for key [ stage.environment] using [microprofile.Config directly from javax.Filter]
Read value [ Optional[GREEN]] for key [ stage.colour] using [microprofile.Config directly from javax.Filter]
Read value [ Optional[CI]] for key [ stage.environment] using [microprofile.Config indirectly via Helper class]
Read value [ Optional[GREEN]] for key [ stage.colour] using [microprofile.Config indirectly via Helper class]
The CI
value comes from application.yaml configuration:
stage:
environment: DEFAULT_VALUE
'%NONE-CI':
stage:
environment: CI
colour: GREEN
Please note, that using standard JVM approach everything works fine.
-
Build application command:
mvn clean package -Dquarkus.package.type=native -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-mandrel:21.3-java11
-
Build the image:
docker build -f src/main/docker/Dockerfile.native -t quarkus/nativeconfig .
-
Run the container with profile NONE-CI activated:
docker run -i --rm -p 8480:8480 -e PROFILE=NONE-CI quarkus/nativeconfig
-
Verify application console output - it should be following (this is reproducible and expected but invalid behavior):
2022-03-14 16:07:55,446 INFO [io.quarkus] (main) nativeconfig 1.0.0-SNAPSHOT native (powered by Quarkus 2.5.0.Final) started in 0.014s. Listening on: http://0.0.0.0:8480
2022-03-14 16:07:55,446 INFO [io.quarkus] (main) Profile NONE-CI activated.
2022-03-14 16:07:55,446 INFO [io.quarkus] (main) Installed features: [cdi, config-yaml, resteasy, servlet, smallrye-context-propagation, vertx]
Read value [ Optional[DEFAULT_VALUE]] for key [ stage.environment] using [microprofile.Config directly from javax.Filter]
Read value [ Optional.empty] for key [ stage.colour] using [microprofile.Config directly from javax.Filter]
Read value [ Optional[CI]] for key [ stage.environment] using [microprofile.Config indirectly via Helper class]
Read value [ Optional[GREEN]] for key [ stage.colour] using [microprofile.Config indirectly via Helper class]
Please note, that reading config values directly from javax.Filter, no profile is used. However as you can see above in logs, there is message "Profile NONE-CI activated".