pom.xml maven springcloud
毛毛的猫毛 人气:0**代码环境:**spring boot 2.1.2,springcloud :Greenwich.RELEASE
**问题描述:**spring-cloud-starter-feign,spring-cloud-starter-eureka 一直无法下载,maven仓库中包路径显示为unknown
pom.xml内容:
<version.spring-cloud>Greenwich.RELEASE</version.spring-cloud> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-feign</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-eureka</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${version.spring-cloud}</version> <type>pom</type> <scope>import</scope> </dependency>
**错误原因:**查看官网及spring中央仓库发现,boot2.1.x对应的cloud版本已经不推荐使用上面的两个jar包,
修改pom.xml
<dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-openfeign</artifactId> </dependency> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> <exclusions> <exclusion> <artifactId>guava</artifactId> <groupId>com.google.guava</groupId> </exclusion> </exclusions> </dependency>
修改后重新reimport,问题解决。这是自己粗心大意造成的问题,特此记录以示警告
注:其他无法下载spring相关包的原因,可能是私服没有配置spring的 中央仓库代理地址
中央仓库地址:https://repo.spring.io/milestone/org/springframework/cloud/spring-cloud-starter-eureka/
加载全部内容