问题描述
尝试使用spring cloud gateway创建自己的api网关
Trying to create my own api gateway using spring cloud gateway
下面是我的 build.gradle 文件,
Below is my build.gradle file,
buildscript {
ext {
springBootVersion = "1.5.9.RELEASE"
}
apply plugin: "io.spring.dependency-management"
apply plugin: "org.springframework.boot"
dependencies {
compile(
'org.springframework.boot:spring-boot-starter-web',
'org.springframework.boot:spring-boot-starter-tomcat',
'org.springframework.boot:spring-boot-starter-actuator',
'org.springframework.boot:spring-boot-starter-webflux',
'org.springframework.cloud:spring-cloud-starter-gateway',
'org.springframework.cloud:spring-cloud-starter-eureka'
)
testCompile(
'org.springframework.boot:spring-boot-starter-test',
'org.springframework.cloud:spring-cloud-starter-eureka-server'
)
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:Finchley.M5"
mavenBom 'org.springframework.cloud:spring-cloud-gateway:2.0.0.BUILD-SNAPSHOT'
}
}
当我尝试刷新 gradle 项目时,出现以下错误
Whwn I am trying to do refresh gradle project, getting below error
0 秒内配置成功无法解决:org.springframework.cloud:spring-cloud-starter-eureka:无法解析:org.springframework.cloud:spring-cloud-starter-eureka-server:
CONFIGURE SUCCESSFUL in 0sCould not resolve: org.springframework.cloud:spring-cloud-starter-eureka:Could not resolve: org.springframework.cloud:spring-cloud-starter-eureka-server:
你能确认一下我的spring boot和云版本吗?
Can you please confirm my spring boot and cloud version?
推荐答案
它们在 Edgware 中被重命名.这一个到 spring-cloud-starter-netflix-eureka-client.另一个到 spring-cloud-starter-netflix-eureka-server.
They were renamed in Edgware. This one to spring-cloud-starter-netflix-eureka-client. The other to spring-cloud-starter-netflix-eureka-server.
这篇关于当我使用 Finchley.M5 时,spring-cloud-starter-eureka 没有解决的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!