Dependency Convergence error for Kotlin library
- Lenguaje dominante
- Java
- Estrellas
- 300
- Forks
- 230
- Merge medio
- 5 d 1 h
- PR fusionados (30 d)
- 5
Descripción
## 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.
Guía de contribución
Línea de trabajo
Comienza ejecutando `mvn validate` en el proyecto de ejemplo e inspecciona la configuración de compilación de Maven del Java SDK y las rutas de dependencias para detectar las versiones conflictivas de la biblioteca estándar de Kotlin. La tarea estará terminada cuando la regla Maven Enforcer Dependency Convergence esté configurada y el error de convergencia existente se haya resuelto sin romper la validación.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- java, kotlin
- Área
- build-system
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100