Skip to content

Cannot override properties from imported config #44723

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

Closed
williamwjs opened this issue Mar 15, 2025 · 1 comment
Closed

Cannot override properties from imported config #44723

williamwjs opened this issue Mar 15, 2025 · 1 comment
Labels
status: invalid An issue that we don't feel is valid

Comments

@williamwjs
Copy link

Assuming the below files on my classpath:

  • application-staging.yml
spring:
  data:
    mongodb:
      uri: stagingUrI

# ... (bunch of other properties)
  • application-dev.yml
spring:
  config:
    import: application-staging.yml
  data:
    mongodb:
      uri: myDevOne

When running with dev profile:

Expected: spring.data.mongodb.uri is myDevOne
Actual: spring.data.mongodb.uri is stagingUrI

Is it something that should support?
Thank you!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 15, 2025
@philwebb
Copy link
Member

This is the expected behavior and is documented in this section of the reference docs. I'd also generally recommend avoiding importing profile specific files directly.

@philwebb philwebb closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2025
@philwebb philwebb added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged labels Mar 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

3 participants