I want to place the git repository in a folder directly above the classpath during the development stage of an application.
Currently, I have this as my Spring Cloud git URI:
spring.cloud.config.server.git.uri=file://${user.dir}/cloud-configuration-repository
This URI points to a folder directly above the classpath.
I get this error, however, during runtime.
***************************
APPLICATION FAILED TO START
***************************
Description:
Invalid config server configuration.
Action:
If you are using the git profile, you need to set a Git URI in your configuration. If you are using a native profile and have spring.cloud.config.server.bootstrap=true, you need to use a composite configuration.
Edit: here is the project structure that I wish to have:
Project
├── _.idea
├── src
| ├── main
| └── test
├── target
└── cloud-configuration-repository
From the documentation:
https://cloud.spring.io/spring-cloud-config/multi/multi__spring_cloud_config_server.html
2.1.3 File System Backend: There is also a “native” profile in the Config Server that does not use Git but loads the config files from the local classpath or file system (any static URL you want to point to with spring.cloud.config.server.native.searchLocations). To use the native profile, launch the Config Server with spring.profiles.active=native.
So, in your case, it would be:
spring.profiles.active=native
spring.cloud.config.server.native:searchLocations=file://${user.dir}/cloud-configuration-repository
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