Lets say I create a binary compatible update of my library foo
from version 1.0.0
to 1.0.1
. Library foo
is published via Maven.
Can I use this minor version update to bump at the same time the minor versions of the dependencies of foo
? For example, version 1.0.0 was using scalaVersion := "2.10.1"
. Can I change that to scalaVersion := "2.10.3"
in foo 1.0.1, or will that cause trouble?
Assume that I use foo
in another project as
"mygroup" %% "foo" % "1.0.+"
There are several considerations involved, but generally yes, you can change the versions of dependencies if they are binary compatible. The Scala team aims for 2.10.x releases to be binary compatible. You can compile against Scala 2.10.1 and use 2.10.3 at runtime.
You can generally do the reverse for the Scala library as long as you use methods and types that are present in both. Most libraries aren't concerned with this direction, though. Other caveats on binary compatibility:
LinkageError
s at runtime).It is not generally recommended to use dynamic revisions like "1.0.+", however. They make reproducing builds harder as well as affecting resolution speed.