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 22:11:15 UTC
[kafka] branch 2.6 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 2.6
in repository https://gitbox.apache.org/repos/asf/kafka.git
The following commit(s) were added to refs/heads/2.6 by this push:
new c675e43 MINOR: Ensure a single version of scala-library is used (#9155)
c675e43 is described below
commit c675e43c31c1ebbcf5694d5aa2b0c8f061945cf4
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 5ed1e84..9a3bbb6 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,