最近学习SpringCloud被依赖的弄晕了。
向请教这个自包下的Eureka依赖的版本号,是不是在父工程的dependencyManagement定义了??
以下为父工程的depentdentManagement
<dependencyManagement>
<dependency>
<groupId>org.springframework.cloudgroupId>
<artifactId>spring-cloud-dependenciesartifactId>
<version>Hoxton.SR1version>
<type>pomtype>
<scope>importscope>
dependency>
dependencyManagement>
以下为子工程的Eureka依赖
<dependency>
<groupId>org.springframework.cloudgroupId>
<artifactId>spring-cloud-starter-netflix-eureka-serverartifactId>
dependency>
是的,已经定义了,就是Hoxton.SR1,不是数字版本号,你是遇到什么问题了。
没定义版本号就会往上查找
其实你可以不用管这个版本号直接在idea查eureka然后添加到项目中就行了
父工程的depentdentManagement已经对SpringCloud常用组件做了版本控制,
spring-cloud-dependencies这个依赖是官方提供的版本限定,也就是说SpringCloud官方已经为我们筛选好了,各组件搭配最合适的版本,所以只需要配置依赖包名即可,所需版本号会默认使用父工程限制的版本号,
如果你不想用也可以直接添加版本号,这样就优先导入自己填写的版本