dapr / dapr/java-sdk

Dependency Convergence error for Kotlin library

Đang mở
#558 1 bình luận 1 reaction 0 người được giao Xem trên GitHub
area/client good first issue P2 size/XS triaged/resolved
Ngôn ngữ chính
Java
Star
300
Fork
230
Merge trung bình
5 ngày 1 giờ
Pull request đã merge (30 ngày)
5

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách chạy `mvn validate` trên project mẫu và kiểm tra cấu hình build Maven của Java SDK cùng các đường dẫn dependency để tìm các phiên bản Kotlin standard-library xung đột. Công việc được xem là hoàn tất khi rule Maven Enforcer Dependency Convergence được cấu hình và lỗi convergence hiện tại được giải quyết mà không làm hỏng quá trình validation.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
java, kotlin
Lĩnh vực
build-system
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.