-
Notifications
You must be signed in to change notification settings - Fork 41.1k
add .config/spring-boot/application-<application-name>-<profile>.<config format> files #39156
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
Comments
been thinking on this more. I think that the pattern I came up with is flawed in that it would be indistinguishable from profile only. Very tired today, but to expand the problem space. We need to be able to have private profile specific, application specific (higher priority) and application profile specific. Honestly devtools specific is kind of silly... Since it could be handled with profile, maybe one that devtools itself adds. So, new thought. Every single properties, etc, that exists is related to an application. @PropertySource(
value = "file:///${user.home}/.config/spring-boot/${spring.application.name}.properties",
ignoreResourceNotFound = true
)
@PropertySource(
value = "file:///${user.home}/.config/spring-boot/application-local.properties",
ignoreResourceNotFound = true
) local in this case would refer to a profile only.
then profile only files could also exist. A motivation for this is that I like to set my own properties locally because certain things annoy me in local dev, specifically I think log statements are far more verbose regarding things like timestamps than I've almost ever wanted them to be. So I like to change the format pattern myself. currently my own implementation using the annotations is limited, and I don't think there's a way to do this with just annotations. For my personal needs it doesn't seem super worth it to implement the full thing since I can essentially stick to my own config formats and statically define profiles for this. I would be willing to PR this though, given how often I keep coming back to this feature. A little guidance would be nice (on accepted result and code location to start) and a bit of a guarantee that should any part of my code be accepted that primary git authorship would be retained. |
Thanks for the suggestion, but we're not keen to add any more complexity to this area. |
So is spring boot never going to get something that allows a standardized location to put credentials external to the application root for developers to avoid accidental committing. That's what I read you as saying. |
2 common problems.
devtools properties are insufficient because it intentionally work at test runtime.
Although it would be easy to add your own property source with a more explicit path, that kind of breaks "conventional" and now I have to convince every single application/repository I use to add such a thing. I'm not actually certain on the right way to support the various formats spring does without creating a property source for each.
These configurations need to be per app, because they might each have different credentials. Also per profile for similar reasons.
I'm not sure if
.config
is hard coded or if it actually supports the XDG spec, which I have no idea how complex it would be for me to support the XDG spec, you could probably do it with a SPeL expression, but still...So my solution is for Spring Boot to simply add support for
grossly simplistic way as workaround
The text was updated successfully, but these errors were encountered: