I am pretty interested in spring cloud project and now I am testing it, but blocked immediately.
- In POM: I added this dependency:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
- For main application:
@Configuration
@EnableAutoConfiguration
@EnableConfigServer
public class SpringConfigServerApplication {
public static void main(String[] args) {
SpringApplication.run(SpringConfigServerApplication.class, args);
}
}
So based on the documentation, I just need to add enableConfigServer
, then I tried to start it, this is the error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'environmentRepository' defined in class org.springframework.cloud.config.server.ConfigServerConfiguration$GitRepositoryConfiguration: Invocation of init method failed; nested exception is java.lang.IllegalStateException: You need to configure a uri for the git repository
So, how can I config a uri for git repository? There is nothing mentioned in the documentation.
Thanks for more clarification