Is it possible to use Spring Cloud Config without using any Git repo at all? I'm trying to test it with a local directory with this in application.properties:
spring.cloud.config.server.git.uri=file://${user.dir}/src/main/resources/config-repo
But I get the following error:
java.lang.IllegalStateException: No .git at file://path/to/src/main/resources/config-repo
So is it not possible to use Spring Cloud if one is not using Git at all?
UPDATE:
Thanks to Spencer's advice, I added the following:
spring.profiles.active=native spring.cloud.config.server.native.searchLocations=${user.dir}/src/main/resources/configs
And I have a file "bar.properties" inside "configs" with the following contents:
foo: bar
But the response I get is not reading the file:
{ "name": "bar", "profiles": [ "default" ], "label": "master", "propertySources": [] }
The URL I'm using is http://localhost:8888/bar/default
Am I missing something else? Thanks again in advance!
Create one file called bootstrap. properties in the src\main\resources directory and add the below properties to connect with the config server along with some required configuration. #Active Profile - will relate to development properties file in the server. #the property file without any environment name at the end.
Overriding the Values of Remote Properties If you want to allow your applications to override the remote properties with their own System properties or config files, the remote property source has to grant it permission by setting spring. cloud. config. allowOverride=true (it doesn't work to set this locally).
Run with spring.profiles.active=native
. See the File System Backend for more details. You'll want to set spring.cloud.config.server.native.searchLocations
to the dirs you want to look at.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With