Spring 2.4.2 - application properties not override properties from included library

Viewed 480

After migration from spring.boot 2.3.3.RELEASE to 2.4.2, I found a problem with property override. My application use library which have application.yml:

oidc:
  gatewayUrl: aaa
  s2s:
    clientId: clientId
    clientSecret: secret
    jwksUrl: http://localhost:9011/oauth/jwks

My application (which include above library) has application.yaml as follows:

oidc:
  gatewayUrl: aaa
  s2s:
    clientId: clientId
    clientSecret: secret123
    jwksUrl: http://dev:9011/oauth/jwks

The problem is that values from my aplication don't ovveride properties from library. I worked fine with version 2.3.3.RELEASE. Looking at override precedence: https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config-files it should work as expected.

Interesting thing is that when:

  1. I have moved application.yaml (from application) to application-dev.yaml

or

  1. I have changed name from application.yaml to application.yml

it works.

It looks that there is a bug in 2.4.2:

There is additional precedence:

- file with extension ".yml" overrides files with ".yaml" extension, even if one of them is in library and other in application.

0 Answers
Related