springCloud的maven依赖的jar包无法下载

1.修改maven的镜像:

<mirror>
        <id>nexus-aliyun</id>
        <mirrorOf>central</mirrorOf>
        <name>Nexus aliyun</name>
        <url>http://maven.aliyun.com/nexus/content/groups/public</url>
    </mirror>

2.由于springCloud不推荐用

spring-cloud-starter-eureka-server
spring-cloud-starter-feign
spring-cloud-starter-eureka-client       

而是推荐使用:

spring-cloud-starter-netflix-eureka-server
spring-cloud-starter-openfeign
spring-cloud-starter-netflix-eureka-client

修改成推荐的maven的坐标id,就能下载下来。

即:

<dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId><!--spring-cloud-starter-eureka-server-->
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-openfeign</artifactId><!--spring-cloud-starter-feign-->
        </dependency>
<!--eureka server -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <!--<artifactId>spring-cloud-starter-eureka-server</artifactId>-->
            <artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
        </dependency>
<dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Greenwich.SR3</version><!--Dalston.RC1-->
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

 

其他原因可能是仓库远程地址问题。




posted @ 2021-08-09 20:08  super超人  阅读(2178)  评论(0编辑  收藏  举报