【发布时间】:2018-10-09 01:13:01
【问题描述】:
版本: springboot-2.0.0.RELEASE springcloud-Finchley.RC1
我的项目依赖于spring-cloud-starter-netflix-eureka-client, 当我像下面这样声明 spring-boot-starter-parent 作为父级时,Idea 可以解析 eureka-client 的版本,
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.RELEASE</version>
</parent>
但是当我像下面这样将 spring-boot-dependencies 导入为 pom 时,Idea 无法解析 eureka-client 的版本, 为什么?
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.0.0.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
spring-boot-starter-parent-2.0.0.RELEASE.pom文件几乎只在头部导入spring-boot-dependencies
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>2.0.0.RELEASE</version>
<relativePath>../../spring-boot-dependencies</relativePath>
</parent>
另外,我像下面这样导入spring cloud
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Finchley.RC1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
【问题讨论】:
-
这是使用 Spring Cloud 的文档化方法。 Spring boot 对此一无所知。
-
我更新了我的问题,spring-boot-starter-parent-2.0.0.RELEASE.pom 文件几乎只在文件头导入 spring-boot-dependencies,所以我认为这两个方式应该都可以。
-
嗨,最后找到解决办法了吗?我搜索了这个问题并点击了这里,一年后当这是发布时,仍然看不到任何解决方案。大声笑
标签: maven spring-boot spring-cloud