Java 无法向netflix eureka注册spring microservice

Java 无法向netflix eureka注册spring microservice,java,spring,spring-cloud,Java,Spring,Spring Cloud,我有maven spring microservice和main类 @EnableEncryptableProperties @SpringBootApplication @EnableDiscoveryClient public class AccountService { private static ApplicationContext applicationContext; public static void main(String[] args) {

我有maven spring microservice和main类

@EnableEncryptableProperties
@SpringBootApplication
@EnableDiscoveryClient
public class AccountService {

    private static ApplicationContext applicationContext;

    public static void main(String[] args) {
        applicationContext = SpringApplication.run(AccountService.class, args);
    }

}
在我的pom.xml中,我添加了以下用于注册应用程序的依赖项

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-config</artifactId>
    <version>2.2.6.RELEASE</version>
</dependency>
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-eureka</artifactId>
    <version>1.3.5.RELEASE</version>
</dependency>
该项目定义了以下spring版本

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.2.6.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

org.springframework.boot
spring启动程序父级
2.2.6.1发布

此外,微服务在启动期间使用bootstrap.properties与SpringCloudConfigServer进行通信,以获取application.properties。与此错误相关的问题可能是什么?

您的
pom.xml
中的依赖项彼此不兼容。你应该使用


如果您不为每个依赖项指定版本,而是使用BOM(
spring cloud dependencies
),则更好,请参见。

您的
pom.xml
中的依赖项彼此不兼容。你应该使用


如果您不为每个依赖项指定版本,而是使用BOM(
spring cloud dependencies
),则更好,请参阅。

您不能混合使用spring cloud的版本。1.x版本与2.x版本不兼容。不能混合使用spring cloud版本。1.x版本与2.x版本不兼容。
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.2.6.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>