You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sorry if this turns out to be a question Andy, seems like a feature
I'd like to be able to have spring search for a profile specific file, by searching upwards, like git will for .gitignore.
Something like file:optional-parent:application-${profile}.properties
this would be useful for things like monorepo support and developer secure credential configuration that works for all clients (cli, IDE, etc). We actually have a multi monorepo situation (libraries and apps)
We don't currently support searching upwards for files. If we wanted to add support we'd probably need to change StandardConfigDataLocationResolver and I think we'd want to make it opt-in rather than a default.
If you want to do this currently, you might be able to use relative import. E.g. in the client app you'd have application.properties with the following:
spring.config.import=../application.properties
That would pick up a shared application.properties (and all profile specific variants) from the parent directory which could contain all the credential properties.
When I tried to do that I didn't seem to be able to figure out the depth. It seemed like perhaps it wasn't consistently using the same directory between IntelliJ and just running as Gradle normally. In fact I'm not sure the depth would be consistent between tests. This is why I think recursive searching would be a better solution, as I did actually try this.
Sorry if this turns out to be a question Andy, seems like a feature
I'd like to be able to have spring search for a profile specific file, by searching upwards, like git will for .gitignore.
Something like
file:optional-parent:application-${profile}.properties
this would be useful for things like monorepo support and developer secure credential configuration that works for all clients (cli, IDE, etc). We actually have a multi monorepo situation (libraries and apps)
current workaround
If this is already possible without writing more code, and without customizing any clients like the IDE, can you please put it in the documentation
The text was updated successfully, but these errors were encountered: