sreekanth opened SPR-13500 and commented

We are facing a similar issue just like reported in spring-boot https://github.com/spring-projects/spring-boot/issues/916

we have some annotation config like below

@Configuration
@PropertySource(value = {
        "classpath:application-config.properties",
        "classpath:application-override.properties",
        "classpath:application-${user.name}-override.properties",
        "classpath:abc-config.properties"}, ignoreResourceNotFound = true)
public class ApplicationConfig { ...

according to my understanding, values in abc-config.properties should have high precedence over the other 3 properties in order, but that's not happening.


Affects: 4.2 GA

Comment From: spring-projects-issues

Juergen Hoeller commented

Our own unit tests indicate that such overriding arrangements work fine... Could you please try to submit a reproducible test case with your specifics?

Juergen

Comment From: spring-projects-issues

sreekanth commented

I'm extremely sorry, that was a mistake from my end. I forced to file a bug due to the code base i was working had stupidest mistake that had a wrong property key name which i was trying to override in the last property file. Sorry for the inconvenience caused by me kindly mark this issue as invalid.

Comment From: spring-projects-issues

Juergen Hoeller commented

No worries...

Comment From: mmuruev

This is the old issue but I have this

@Configuration 
@PropertySource(value = {"classpath:application.properties", "classpath:application-override.properties"})
public class TestConfig {
    @Value("${spring.test.env}")
    private Boolean isTest;
}

and If I put spring.test.env in application-override.properties or in application.properties It works as expected. But if I put in booth value from application-override.properties completely ignored. Kinda controversy about what I want to have.

application.properties in - main resources application-override.properties in - test resources

And I'm trying to override things for integration tests