背景:

学习spring-cloud时,提示:org.springframework.cloud:spring-cloud-starter-netflix-eureka-server:unknown

问题原因:根据排查原因是springboot和spring-cloud依赖的包冲突

解决方式

        <!--eureka 客户端依赖 -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.cloud</groupId>
                    <artifactId>spring-cloud-commons</artifactId>
                </exclusion>
            </exclusions>
        </dependency>

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-commons</artifactId>
            <version>2.1.0.RELEASE</version>
        </dependency>

 

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐