Skip to content
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

@PropertySource not overriding in order [SPR-13500] #18078

Closed
spring-projects-issues opened this issue Sep 24, 2015 · 4 comments
Closed

@PropertySource not overriding in order [SPR-13500] #18078

spring-projects-issues opened this issue Sep 24, 2015 · 4 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: invalid An issue that we don't feel is valid

Comments

@spring-projects-issues
Copy link
Collaborator

sreekanth opened SPR-13500 and commented

We are facing a similar issue just like reported in spring-boot spring-projects/spring-boot#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

@spring-projects-issues
Copy link
Collaborator Author

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

@spring-projects-issues
Copy link
Collaborator Author

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.

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

No worries...

@spring-projects-issues spring-projects-issues added type: bug A general bug status: invalid An issue that we don't feel is valid in: core Issues in core modules (aop, beans, core, context, expression) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues removed the type: bug A general bug label Jan 12, 2019
@mmuruev
Copy link

mmuruev commented Oct 19, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants