Skip to content

Commit

Permalink
MINOR: Ensure a single version of scala-library is used (#9155)
Browse files Browse the repository at this point in the history
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 <ismael@juma.me.uk>
  • Loading branch information
stanislavkozlovski authored and ijuma committed Aug 10, 2020
1 parent cd05b69 commit f3257cf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,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,
Expand Down

0 comments on commit f3257cf

Please sign in to comment.