Skip to content

Commit

Permalink
refactor(dependency): add explicit resilience4j-vavr dependency with …
Browse files Browse the repository at this point in the history
…spring boot upgrade to 3.x

While upgrading the spring boot to 3.0.13 and spring cloud 2022.0.5, encountered the below error:
```
> Task :fiat-sql:compileKotlin FAILED
e: /fiat/fiat-sql/src/main/kotlin/com/netflix/spinnaker/fiat/permissions/SqlPermissionsRepository.kt: (36, 11): Unresolved reference: vavr
e: /fiat/fiat-sql/src/main/kotlin/com/netflix/spinnaker/fiat/permissions/SqlPermissionsRepository.kt: (49, 25): Unresolved reference: PreDestroy
e: /fiat/fiat-sql/src/main/kotlin/com/netflix/spinnaker/fiat/permissions/SqlPermissionsRepository.kt: (550, 13): Unresolved reference: Try
e: /fiat/fiat-sql/src/main/kotlin/com/netflix/spinnaker/fiat/permissions/SqlPermissionsRepository.kt: (561, 13): Unresolved reference: Try
e: /fiat/fiat-sql/src/main/kotlin/com/netflix/spinnaker/fiat/permissions/SqlPermissionsRepository.kt: (599, 6): Unresolved reference: PreDestroy

FAILURE: Build completed with 2 failures.
```
The root cause of this issue is removal of `io.vavr` dependency from resilience4j:2.0.2.
https://github.com/resilience4j/resilience4j/releases/tag/v2.0.0
Resilience4j comes as transitive dependency of spring-cloud-dependencies.
https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-dependencies/2022.0.5

Dependency insight before spring cloud upgrade:
```
$ ./gradlew fiat-sql:dI --dependency io.vavr:vavr:

> Task :fiat-sql:dependencyInsight
io.vavr:vavr:0.10.2
  Variant compile:
    | Attribute Name                     | Provided | Requested         |
    |------------------------------------|----------|-------------------|
    | org.gradle.status                  | release  |                   |
    | org.gradle.category                | library  | library           |
    | org.gradle.libraryelements         | jar      | classes+resources |
    | org.gradle.usage                   | java-api | java-api          |
    | org.gradle.dependency.bundling     |          | external          |
    | org.gradle.jvm.environment         |          | standard-jvm      |
    | org.gradle.jvm.version             |          | 17                |
    | org.jetbrains.kotlin.platform.type |          | jvm               |

io.vavr:vavr:0.10.2
+--- io.github.resilience4j:resilience4j-annotations:1.7.0
|    +--- io.spinnaker.kork:kork-bom:7.247.0
|    |    \--- compileClasspath
|    +--- io.spinnaker.kork:kork-core:7.247.0
|    |    +--- io.spinnaker.kork:kork-bom:7.247.0 (*)
|    |    +--- io.spinnaker.kork:kork-sql:7.247.0
|    |    |    +--- compileClasspath (requested io.spinnaker.kork:kork-sql)
|    |    |    \--- io.spinnaker.kork:kork-bom:7.247.0 (*)
|    |    \--- io.spinnaker.kork:kork-web:7.247.0
|    |         +--- compileClasspath (requested io.spinnaker.kork:kork-web)
|    |         \--- io.spinnaker.kork:kork-bom:7.247.0 (*)
|    \--- io.github.resilience4j:resilience4j-spring:1.7.0
|         +--- io.spinnaker.kork:kork-bom:7.247.0 (*)
|         \--- io.github.resilience4j:resilience4j-spring-boot2:1.7.0
|              +--- io.spinnaker.kork:kork-bom:7.247.0 (*)
|              \--- io.spinnaker.kork:kork-core:7.247.0 (*)
+--- io.github.resilience4j:resilience4j-bulkhead:1.7.0
|    +--- io.spinnaker.kork:kork-bom:7.247.0 (*)
|    \--- io.github.resilience4j:resilience4j-framework-common:1.7.0
|         \--- io.github.resilience4j:resilience4j-spring:1.7.0 (*)
+--- io.github.resilience4j:resilience4j-circuitbreaker:1.7.0
|    +--- io.spinnaker.kork:kork-bom:7.247.0 (*)
|    \--- io.github.resilience4j:resilience4j-framework-common:1.7.0 (*)
+--- io.github.resilience4j:resilience4j-circularbuffer:1.7.0
|    +--- io.spinnaker.kork:kork-bom:7.247.0 (*)
|    \--- io.github.resilience4j:resilience4j-consumer:1.7.0
|         +--- io.spinnaker.kork:kork-bom:7.247.0 (*)
|         \--- io.github.resilience4j:resilience4j-spring:1.7.0 (*)
+--- io.github.resilience4j:resilience4j-consumer:1.7.0 (*)
+--- io.github.resilience4j:resilience4j-core:1.7.0
|    +--- io.spinnaker.kork:kork-bom:7.247.0 (*)
|    +--- io.github.resilience4j:resilience4j-framework-common:1.7.0 (*)
|    +--- io.github.resilience4j:resilience4j-retry:1.7.0
|    |    +--- compileClasspath (requested io.github.resilience4j:resilience4j-retry)
|    |    +--- io.spinnaker.kork:kork-bom:7.247.0 (*)
|    |    +--- io.spinnaker.kork:kork-core:7.247.0 (*)
|    |    \--- io.github.resilience4j:resilience4j-framework-common:1.7.0 (*)
|    +--- io.github.resilience4j:resilience4j-consumer:1.7.0 (*)
|    +--- io.github.resilience4j:resilience4j-circuitbreaker:1.7.0 (*)
|    +--- io.github.resilience4j:resilience4j-ratelimiter:1.7.0
|    |    +--- io.spinnaker.kork:kork-bom:7.247.0 (*)
|    |    \--- io.github.resilience4j:resilience4j-framework-common:1.7.0 (*)
|    +--- io.github.resilience4j:resilience4j-bulkhead:1.7.0 (*)
|    \--- io.github.resilience4j:resilience4j-timelimiter:1.7.0
|         +--- io.spinnaker.kork:kork-bom:7.247.0 (*)
|         \--- io.github.resilience4j:resilience4j-framework-common:1.7.0 (*)
+--- io.github.resilience4j:resilience4j-framework-common:1.7.0 (*)
+--- io.github.resilience4j:resilience4j-micrometer:1.7.0
|    +--- io.spinnaker.kork:kork-bom:7.247.0 (*)
|    \--- io.github.resilience4j:resilience4j-spring-boot2:1.7.0 (*)
+--- io.github.resilience4j:resilience4j-ratelimiter:1.7.0 (*)
+--- io.github.resilience4j:resilience4j-retry:1.7.0 (*)
+--- io.github.resilience4j:resilience4j-spring:1.7.0 (*)
+--- io.github.resilience4j:resilience4j-spring-boot2:1.7.0 (*)
\--- io.github.resilience4j:resilience4j-timelimiter:1.7.0 (*)
```

After spring cloud upgrade:
```
$ ./gradlew fiat-sql:dI --dependency io.vavr:vavr:

> Task :fiat-sql:dependencyInsight
No dependencies matching given input were found in configuration ':fiat-sql:compileClasspath'

```
In order to fix this issue adding explicit dependency of `resilience4j-vavr`.

After adding dependency:
```
$ ./gradlew fiat-sql:dI --dependency io.vavr:vavr:

> Task :fiat-sql:dependencyInsight
io.vavr:vavr:0.10.2
  Variant compile:
    | Attribute Name                     | Provided | Requested         |
    |------------------------------------|----------|-------------------|
    | org.gradle.status                  | release  |                   |
    | org.gradle.category                | library  | library           |
    | org.gradle.libraryelements         | jar      | classes+resources |
    | org.gradle.usage                   | java-api | java-api          |
    | org.gradle.dependency.bundling     |          | external          |
    | org.gradle.jvm.environment         |          | standard-jvm      |
    | org.gradle.jvm.version             |          | 17                |
    | org.jetbrains.kotlin.platform.type |          | jvm               |

io.vavr:vavr:0.10.2
\--- io.github.resilience4j:resilience4j-vavr:2.0.2
     +--- compileClasspath (requested io.github.resilience4j:resilience4j-vavr)
     \--- io.spinnaker.kork:kork-bom:sb-3-0-13-2-SNAPSHOT
          \--- compileClasspath
```
  • Loading branch information
j-sandy committed Jan 3, 2025
1 parent 991c074 commit 355837c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fiat-sql/fiat-sql.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ dependencies {

implementation "io.strikt:strikt-core"
implementation "io.github.resilience4j:resilience4j-retry"
implementation "io.github.resilience4j:resilience4j-vavr"

implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core"
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-slf4j"
Expand Down

0 comments on commit 355837c

Please sign in to comment.