build by calling gradle fatJar

start with java -jar build/libs/demo-0.0.1-SNAPSHOT.jar

Java version used: 17

the value defined in src\main\resources\application.yml is ignored.

It is used correctly if the application is started by gradle bootRun

demo.zip

Comment From: mdeinum

You are using Spring Boot for which you should use the Spring Boot plugin to build the executable jar, not your own task. Instead run ./gradlew build and use the resulting jar. Remove the fatJar task.

Comment From: scheruga

Thanks for the info. That way it is working perfectly