Skip to content

Document the need for configuration files to have a file extension #22278

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
prabdeb opened this issue Jul 9, 2020 · 2 comments
Closed

Document the need for configuration files to have a file extension #22278

prabdeb opened this issue Jul 9, 2020 · 2 comments
Assignees
Labels
type: documentation A documentation update
Milestone

Comments

@prabdeb
Copy link

prabdeb commented Jul 9, 2020

Not reading properties for property file passed by -Dspring.config.location=<property file>, where <property file> does not have any extension.

Reproduce: Execute the the following example command -

java -Dspring.config.location=/mount/application-secret-property -jar /home/user/application.war

Where /mount/application-secret-property does not have any extension

Related discussions:

  1. stackoverflow - spring-config-location-is-ignored
  2. Related code in spring boot
  3. Some more discussion on use case
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 9, 2020
@wilkinsona
Copy link
Member

Thanks for the report. This is working as designed so I think we should update the documentation. We should note that a file extension is required to identify which loader should handle the file. This applies both to a location that points to an individual file and to the files in a directory that is specified as the config location.

@wilkinsona
Copy link
Member

wilkinsona commented Jul 9, 2020

Actually, let's do two things. In addition to updating the documentation which we can do now, we can also consider adding support for loading configuration from files with no extension so that you don't have to rename the file to get it to work. I've opened #22280 to track that.

@wilkinsona wilkinsona changed the title Not reading properties for property file passed by -Dspring.config.location=<property file> Document the need for configuration files to have a file extension Jul 9, 2020
@wilkinsona wilkinsona added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 9, 2020
@wilkinsona wilkinsona added this to the 2.2.x milestone Jul 9, 2020
@wilkinsona wilkinsona self-assigned this Jul 27, 2020
@wilkinsona wilkinsona modified the milestones: 2.2.x, 2.2.10 Jul 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

No branches or pull requests

3 participants