简体   繁体   中英

Where do set scala and java versions in a multi-module sbt project?

My sbt project is based on this layout: Confused how to setup a multi project sbt project

How and where exactly should I set the scala and java version?

I'm currently have problems with java versions when deploying so I need to be more explicit about it.

Easiest is to add this to Commons.settings ( scalaVersion := "2.11.1" ). You can still override the versions in project specific settings later.

It will look like this:

val settings: Seq[Def.Setting[_]] = Seq(
  version := appVersion,
  resolvers += Opts.resolver.mavenLocalFile,
  scalaVersion := "2.11.1"
)

And to override:

lazy val appWeb = (project in file("app-web")).
  settings(Commons.settings: _*).
  settings(playScalaSettings: _*).
  settings(scalaVersion := "2.10.3").
  dependsOn(appServices)

I'm not sure how you want to set the Java version though. But there's a post about it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM