Reputation: 2569
How do I reference resources
directory (Or a directory relative to my source files) as my local git uri for the config server (On Windows)?
I've tried file:///resources
and file:///full/path/to/resources
, all seem to fail.
As requested, here's some code:
ConfigServiceApplication.java
@EnableConfigServer
@SpringBootApplication
public class ConfigServiceApplication {
public static void main(String[] args) {
SpringApplication.run(ConfigServiceApplication.class, args);
}
}
application.properties
spring.cloud.config.server.git.uri=file:///full/path/to/resources
spring.application.name=config-service
server.port=8888
Upvotes: 2
Views: 2133
Reputation: 1
If you are using a different branch from main (e.g. master), make sure to configure Spring Cloud Config Server to use that branch by adding in your application.properties
file:
spring.cloud.config.server.git.default-label:master
Upvotes: 0
Reputation: 2569
I'm embarrassed to write this but intellij wouldn't clean the build. I ran the gradle task and it all worked out.
Upvotes: 1
Reputation: 1073
If you want to use file system as a backend, simply try this settings:
spring.profiles.active=native
spring.cloud.config.server.native.searchLocations: file:///full/path/to/resources
See also this documentation
Upvotes: 1