Lagom upgrade from 1.3 to 1.4. Crosscompile or what is correct procedure?

Hi all

We have several services implemented with Lagom 1.3.10 and we will start migrating them to Lagom 1.4
Services are implemented in Java and we use sbt for builds.
We would like to upgrade services as we go and not all at once.

Lets say that service_B depends/calls on service_A. Lets say we want to upgrade service_A first to Lagom 1.4 while service_B stays on Lagom 1.3.

My question is regarding scala versions / sbt cross-compile.

Should we cross compile the service_A for Scala 2.11 and 2.12 using sbt crossScalaVersions as described here:
Then we can continue development of service_B using scala 2.11 until we upgrade service_B to Lagom 1.4 and Scala 2.12

Or should we just compile service_A for Lagom 1.4 and Scala 2.12? Can we use the service_A_api-2.12.jar as a dependency for service_B which is still compiled to Lagom 1.3 and Scala 2.11?

In the upgrade notes I couldn’t find any guidelines regarding scala version.


1 Like

You shouldn’t mix Scala 2.11 and 2.12 artifacts in the same process, so you shouldn’t try to consume an API built for 2.12 in a Lagom 1.3.x service.

Note that Lagom 1.4 doesn’t require Scala 2.12, so the simplest thing is to continue using Scala 2.11 artifacts across all of your services until they’re all updated to Lagom 1.4.

If your services are all implemented in Java, then the Scala version doesn’t matter too much. This will just affect the transitive dependencies on the Lagom framework itself. If you’re not updating all of your services at once, then you’ll want to be sure that a Lagom 1.3.x service that depends on a Lagom 1.4.x API does not bring in transitive dependencies on Lagom 1.4.x anyway. You can prevent this using dependency overrides in the consuming service or the “provided” scope in the API.