Using Spring Cloud Config without Git repo

Turar picture Turar · Oct 16, 2015 · Viewed 24.8k times · Source

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!

Answer

spencergibb picture spencergibb · Oct 16, 2015

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.