Adding feign-client dependency is causing error! I cannot start the application

Viewed 412

I only added this dependency and i am not able to start my application.

Can you explain why it is happening? Without this dependency the spring-boot application is working. I tried to use 2.5.4 and 2.4.2 versions of spring-boot. It is causing the following error:

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-feign</artifactId>
        <version>1.4.7.RELEASE</version>
    </dependency>

Caused by: java.io.FileNotFoundException: class path resource [org/springframework/boot/autoconfigure/web/ServerPropertiesAutoConfiguration.class] cannot be opened because it does not exist

1 Answers

I was facing same issue and I resolved it . in your pom , remove version from all spring-cloud dependency and then add below thing in your pom :

<properties>
        <java.version>1.8</java.version>
        <spring-cloud.version>2021.0.1</spring-cloud.version>
    </properties>

and

<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>

Note : please pick version as per your requirements. thanks.

Related