'using eureka server in spring application, could not find different methods

I have a Gradle project where I try to start a Eureka Server. Here is my Setup:

dependencies {
    implementation 'org.springframework.cloud:spring-cloud-starter-eureka-server:+'
    // compileOnly('org.springframework.cloud:spring-cloud-starter-netflix-eureka-server:+')
}

In this way I try to start the Application :

@SpringBootApplication
@EnableEurekaServer
public class EurekaServer {

    public static void main(String[] args) {
        SpringApplication.run(EurekaServer.class, args);
    }
}

But unfortunately some errors occurred:

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:161)

The following method did not exist:

    'void org.springframework.boot.builder.SpringApplicationBuilder.<init>(java.lang.Object[])'
Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.cloud.bootstrap.BootstrapApplicationListener and org.springframework.boot.builder.SpringApplicationBuilder

Thanks



Solution 1:[1]

Looks like a problem with your dependencies version. please look into a similar issue. Correct the classpath of your application so that it contains a single, compatible version of org.springframework.plugin.core.PluginRegistry

possible to share build.gradle file

Solution 2:[2]

Thank you for your answer. I found the solution. I updated my dependencies in this way :

dependencies {
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server:+'
implementation 'com.google.code.gson:gson:+'

}

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 pred
Solution 2 8u3631984