There are several considerations, but usually yes, you can change the dependency versions if they are compatible with binary files. The Scala team aims to ensure that versions 2.10.x are compatible with binary files. You can compile with Scala 2.10.1 and use 2.10.3 at runtime.
You can usually backtrack the Scala library as long as you use the methods and types present in both. However, most libraries are not interested in this direction. Other binary compatibility disclaimers:
- Different libraries have different policies regarding what versions mean.
- Libraries may or may not have automation to check binary compatibility.
- Automation, such as MiMa (used by Scala), does not catch all kinds of incompatibilities. For example, MiMa only catches "syntactic" incompatibilities (those that throw a
LinkageError at run time). - Binary compatibility does not imply source compatibility.
Usually it is not recommended to use dynamic changes, for example "1.0. +". They make assembly more complex and also affect resolution.
source share