You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by ij...@apache.org on 2020/08/10 20:10:53 UTC

[kafka] branch trunk updated: MINOR: Ensure a single version of scala-library is used (#9155)

This is an automated email from the ASF dual-hosted git repository.

ijuma pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 3fdf152  MINOR: Ensure a single version of scala-library is used (#9155)
3fdf152 is described below

commit 3fdf1523a369e9e2f03e215f39c0ed987b2a16c5
Author: Stanislav Kozlovski <st...@outlook.com>
AuthorDate: Mon Aug 10 23:09:50 2020 +0300

    MINOR: Ensure a single version of scala-library is used (#9155)
    
    This patch ensures we use a force resolution strategy for the scala-library dependency.
    
    I've tested this locally and saw a difference in the output.
    
    With the change (using 2.4 and the jackson library 2.10.5):
    ```
    ./core/build/dependant-libs-2.12.10/scala-java8-compat_2.12-0.9.0.jar
    ./core/build/dependant-libs-2.12.10/scala-collection-compat_2.12-2.1.2.jar
    ./core/build/dependant-libs-2.12.10/scala-reflect-2.12.10.jar
    ./core/build/dependant-libs-2.12.10/scala-logging_2.12-3.9.2.jar
    ./core/build/dependant-libs-2.12.10/scala-library-2.12.10.jar
    ```
    
    Without (using 2.4 and the jackson library 2.10.5):
    ```
     find . -name 'scala*.jar'
    ./core/build/dependant-libs-2.12.10/scala-java8-compat_2.12-0.9.0.jar
    ./core/build/dependant-libs-2.12.10/scala-collection-compat_2.12-2.1.2.jar
    ./core/build/dependant-libs-2.12.10/scala-reflect-2.12.10.jar
    ./core/build/dependant-libs-2.12.10/scala-logging_2.12-3.9.2.jar
    ./core/build/dependant-libs-2.12.10/scala-library-2.12.12.jar
    ```
    
    Reviewers: Ismael Juma <is...@juma.me.uk>
---
 build.gradle | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/build.gradle b/build.gradle
index d97f8e0..7f0cba5 100644
--- a/build.gradle
+++ b/build.gradle
@@ -78,6 +78,12 @@ allprojects {
       runtime {
         resolutionStrategy {
           force(
+            // ensure we have a single version of scala jars in the classpath, we enable inlining
+            // in the scala compiler for the `core` module so binary compatibility is only
+            // guaranteed if the exact same version of the scala jars is used for compilation
+            // and at runtime
+            libs.scalaLibrary,
+            libs.scalaReflect,
             // ensures we have a single version of jackson-annotations in the classpath even if
             // some modules only have a transitive reference to an older version
             libs.jacksonAnnotations,