我对Spring Cloud项目非常感兴趣,目前正在测试它,但遇到了阻碍。
- POM文件中,我添加了以下依赖:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-config-server</artifactId>
</dependency>
- 主要应用程序:
@Configuration
@EnableAutoConfiguration
@EnableConfigServer
public class SpringConfigServerApplication {
public static void main(String[] args) {
SpringApplication.run(SpringConfigServerApplication.class, args);
}
}
根据文档,我只需要添加enableConfigServer
,然后尝试启动,但是出现了以下错误:那么,如何为git存储库配置uri?文档中没有提到。感谢您进一步的澄清。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