Skip to content

Config data location does not exist error can be thrown if a profile-specific properties file is directly imported #26147

Closed
@scottfrederick

Description

@scottfrederick

Create a trivial app from start.spring.io and add four properties file like these:

application.yml:

spring:
  config:
    import: classpath:/imported.yml

some:
  property: "value"

application-dev.yml

spring:
  config:
    import: classpath:/imported-dev.yml

some:
  property: "dev-value"

imported.yml

some:
  property: "imported-value"

imported-dev.yml

some:
  property: "imported-dev-value"

Running the app with the dev profile active will cause an error indicating that imported-dev.yml does not exist, when in fact it does.

***************************
APPLICATION FAILED TO START
***************************

Description:

Config data location 'classpath:/imported-dev.yml' does not exist

Action:

Check that the value 'classpath:/imported-dev.yml' at class path resource [application-dev.yml] - 3:13 is correct, or prefix it with 'optional:'

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions