Spring cloud dependency uses resilience4j package which conflicts with explicit declaration. How to sort it?
I tried a couple of things like:
- Added exclusions
- Directly imported the library
- Added bom
Nothing helped out.
pom.xml has the following configuration:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.5</version>
<relativePath/>
</parent>
<properties>
<spring-cloud.version>2022.0.1</spring-cloud.version>
</properties>
<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>
<dependency>
<groupId>io.github.resilience4j</groupId>
<artifactId>resilience4j-spring-boot3</artifactId>
<version>2.2.0</version>
</dependency>
***************************
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:
io.github.resilience4j.spring6.bulkhead.configure.threadpool.ThreadPoolBulkheadConfiguration.createBulkheadRegistry(ThreadPoolBulkheadConfiguration.java:105)
The following method did not exist:
'io.github.resilience4j.bulkhead.ThreadPoolBulkheadRegistry io.github.resilience4j.bulkhead.ThreadPoolBulkheadRegistry.of(java.util.Map, io.github.resilience4j.core.registry.RegistryEventConsumer, java.util.Map)'
The calling method's class, io.github.resilience4j.spring6.bulkhead.configure.threadpool.ThreadPoolBulkheadConfiguration, was loaded from the following location:
jar:file:/.m2/repository/io/github/resilience4j/resilience4j-spring6/2.2.0/resilience4j-spring6-2.2.0.jar!/io/github/resilience4j/spring6/bulkhead/configure/threadpool/ThreadPoolBulkheadConfiguration.class
The called method's class, io.github.resilience4j.bulkhead.ThreadPoolBulkheadRegistry, is available from the following locations:
jar:file:/.m2/repository/io/github/resilience4j/resilience4j-bulkhead/1.7.0/resilience4j-bulkhead-1.7.0.jar!/io/github/resilience4j/bulkhead/ThreadPoolBulkheadRegistry.class
jar:file:/.m2/repository/io/github/resilience4j/resilience4j-bulkhead/2.2.0/resilience4j-bulkhead-2.2.0.jar!/io/github/resilience4j/bulkhead/ThreadPoolBulkheadRegistry.class
The called method's class hierarchy was loaded from the following locations:
io.github.resilience4j.bulkhead.ThreadPoolBulkheadRegistry: file:/.m2/repository/io/github/resilience4j/resilience4j-bulkhead/1.7.0/resilience4j-bulkhead-1.7.0.jar
Action:
Correct the classpath of your application so that it contains compatible versions of the classes io.github.resilience4j.spring6.bulkhead.configure.threadpool.ThreadPoolBulkheadConfiguration and io.github.resilience4j.bulkhead.ThreadPoolBulkheadRegistry