It seems the documentation is showing the wrong order for configuration properties.
The correct order judging from ConfigDataEnvironment
and the remainder of the documentation is:
locations.add(ConfigDataLocation.of("optional:classpath:/"));
locations.add(ConfigDataLocation.of("optional:classpath:/config/"));
locations.add(ConfigDataLocation.of("optional:file:./"));
locations.add(ConfigDataLocation.of("optional:file:./config/*/"));
locations.add(ConfigDataLocation.of("optional:file:./config/"));
But the documentation states the subdirectories of ./config
are loaded last. I have corrected this and added 'in the current directory' to make sure everyone understands which subdirectories are meant.
I have not verified this is actually the correct loading order, but the code seems clear enough to me.
Comment From: philwebb
Thanks for the PR @MikeN123. After some discussion we think it would be better to change the code rather than the docs. I've opened #24308 to deal with that.