0

Version: springboot-2.0.0.RELEASE springcloud-Finchley.RC1

My project depend on spring-cloud-starter-netflix-eureka-client, when I declare spring-boot-starter-parent as the parent like below,Idea can resovle the version of eureka-client,

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.0.RELEASE</version>
</parent>

but when i import spring-boot-dependencies as pom like below ,Idea can not resovle the version of eureka-client, why?

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-dependencies</artifactId>
        <version>2.0.0.RELEASE</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>

The spring-boot-starter-parent-2.0.0.RELEASE.pom file almost only import spring-boot-dependencies at the head

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-dependencies</artifactId>
    <version>2.0.0.RELEASE</version>
    <relativePath>../../spring-boot-dependencies</relativePath>
</parent>

plus,I import spring cloud like below

<dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-dependencies</artifactId>
        <version>Finchley.RC1</version>
        <type>pom</type>
        <scope>import</scope>
    </dependency>
3
  • That is the documented way to use spring cloud. Spring boot knows nothing about it. Commented Apr 28, 2018 at 10:06
  • I updated my question,the spring-boot-starter-parent-2.0.0.RELEASE.pom file almost only import spring-boot-dependencies at the head of the file,so I think the two way should be both OK. Commented Apr 28, 2018 at 12:14
  • Hey, have you found a solution at the end? I search this problem and hit here, a year later when this was post, still see no solution. lol Commented Apr 25, 2019 at 15:48

1 Answer 1

0

Maybe put the spring-cloud-dependencies into the dependencyManagement block like this:

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>${spring-cloud.version}</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.