Dependency Convergence error for Kotlin library
- 主要言語
- Java
- スター
- 300
- フォーク
- 230
- 平均マージ
- 5日 1時間
- マージ済み PR(30日)
- 5
説明
## Describe the proposal
I propose to add the [Maven Enforcer Plugin](https://maven.apache.org/enforcer/maven-enforcer-plugin/) to the project build, and more specifically, to enforce the ["Dependency Convergence" rule](https://maven.apache.org/enforcer/enforcer-rules/dependencyConvergence.html).
This rule ensures that for each dependency, it is possible to resolve to one and only one version.
Quoting an example from the documentation:
> This rule requires that dependency version numbers converge. If a project has two dependencies, A and B, both depending on the same artifact, C, this rule will fail the build if A depends on a different version of C than the version of C depended on by B.
Currently, dependency version numbers do not converge. I have attached a [sample project](https://github.com/dapr/java-sdk/files/6572018/dapr-dependency-convergence.zip) which depends only on Dapr, that illustrates this. If you run `mvn validate` on the project, you see:
```
Dependency convergence error for org.jetbrains.kotlin:kotlin-stdlib:1.4.0 paths to dependency are:
+-it.mulders.dapr:dapr-dependency-convergence:1.0-SNAPSHOT
+-io.dapr:dapr-sdk:1.1.0
+-com.squareup.okhttp3:okhttp:4.9.0
+-com.squareup.okio:okio:2.8.0
+-org.jetbrains.kotlin:kotlin-stdlib:1.4.0
and
+-it.mulders.dapr:dapr-dependency-convergence:1.0-SNAPSHOT
+-io.dapr:dapr-sdk:1.1.0
+-com.squareup.okhttp3:okhttp:4.9.0
+-org.jetbrains.kotlin:kotlin-stdlib:1.4.10
```
So, my proposal is two-fold:
1. Add the plugin + rule to prevent this kind of situation in the future
2. Solve the current convergence error
PS. I'm not sure if this should be a proposal or rather a bug report. Feel free to change to bug report if you think that's more appropriate.
コントリビューションガイド
調査の方向性
Start by running `mvn validate` against the sample project and inspect the Java SDK's Maven build configuration and dependency paths for the conflicting Kotlin standard-library versions. Done means the Maven Enforcer Dependency Convergence rule is configured and the existing convergence error is resolved without breaking validation.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- java, kotlin
- 領域
- build-system
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100