scalaVersion of lagom-internal-meta-* projects is hard coded to 2.11.7
See original GitHub issueLagom Version - 1.3.6
This is an issue with the Lagom SBT plugin
API : SBT/Scala
Operating System (Centos 7)
uname -a Linux sherpavm 3.10.0-327.10.1.el7.x86_64 #1 SMP Tue Feb 16 17:03:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
JDK (Oracle 1.8.0_112, OpenJDK 1.8.x, Azul Zing)
java -version openjdk version “1.8.0_77” OpenJDK Runtime Environment (build 1.8.0_77-b03) OpenJDK 64-Bit Server VM (build 25.77-b03, mixed mode)
Library Dependencies
This is an issue when using ensime. The ensime plugin only supports a single version of scala for a project and it’s dependencies. Since the internal-meta projects are dynamic, it doesn’t look like you can change the scalaVersion
setting in your build.sbt. Adding ensimeIgnoreScalaMismatch in ThisBuild := true
interacts very badly with the dynamic projects. Enumerating the projects that you want ensime to use on the ensimeConfig
command line, without listing the dynamic projects is a workaround, but quite cumbersome.
I’ll be happy to submit a PR if we can agree that this should be addressed, and where to get the scalaVersion for the dynamic projects.
Expected Behavior
Please describe the expected behavior of the issue, starting from the first action.
- scalaVersion in ThisBuild := “2.11.8”
- show scalaVersion - should displays 2.11.8 for all projects defined in build.sbt
- show show lagom-internal-meta-project-cassandra/scalaVersion - should display 2.11.8
Actual Behavior
Please provide a description of what actually happens, working from the same starting point.
Be descriptive: “it doesn’t work” does not describe what the behavior actually is – instead, say “the page renders a 500 error code with no body content.” Copy and paste logs, and include any URLs.
- scalaVersion in ThisBuild := “2.11.8”
- show scalaVersion - should displays 2.11.8 for all projects defined in build.sbt
show scalaVersion [info] itemImpl/:scalaVersion [info] 2.11.8 [info] searchImpl/:scalaVersion [info] 2.11.8 [info] searchApi/:scalaVersion [info] 2.11.8 [info] userApi/:scalaVersion [info] 2.11.8 [info] biddingImpl/:scalaVersion [info] 2.11.8 [info] webGateway/:scalaVersion [info] 2.11.8 [info] biddingApi/:scalaVersion [info] 2.11.8 [info] itemApi/:scalaVersion [info] 2.11.8 [info] userImpl/:scalaVersion [info] 2.11.8 [info] root/:scalaVersion [info] 2.11.8
- show show lagom-internal-meta-project-cassandra/scalaVersion
show lagom-internal-meta-project-cassandra/scalaVersion [info] 2.11.7
From LagomPlugin.scala:
private val kafkaServerProject = Project("lagom-internal-meta-project-kafka", file("."),
configurations = Configurations.default,
settings = CorePlugin.projectSettings ++ IvyPlugin.projectSettings ++ JvmPlugin.projectSettings ++ Seq(
scalaVersion := "2.11.7",
libraryDependencies += LagomImport.component("lagom-kafka-server"),
lagomKafkaStart in ThisBuild := startKafkaServerTask.value,
lagomKafkaStop in ThisBuild := Servers.KafkaServer.tryStop(new SbtLoggerProxy(state.value.log))
))
`
### Reproducible Test Case
An unchanged https://github.com/lagom/online-auction-scala demonstrates this. I believe that any lagom project can reproduce, given the hard-coded version numbers in LagomPlugin.scala.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:8 (4 by maintainers)
Top GitHub Comments
@steinybot The combination of using the silencer & Lagom results in a very nasty situation indeed!
I could not import my project in Intellij via sbt or bloop after updating to Lagom 1.6.4.
The problem comes from this in
build.sbt
:Since the Lagom 1.6.4 plugin hardcodes scala 2.12.10 for the meta projects and since there is no version of the silencer plugin for that version of Scala, sbt failed.
The workaround is to add the silencer plugin explicitly in the projects that need it.
That’s good enough for now but this bug definitely needs to be fixed.
This is a big problem when adding an sbt plugin which adds compiler plugins which require a specific Scala version (e.g. silencer), especially considered that due to https://github.com/sbt/sbt/issues/5661 it is not possible to override the Scala version of the extra projects.
Does it need to be set at? Can it not delegate to the build setting? Assuming that works for extra projects.