简体   繁体   English

在多模块sbt项目中应在哪里设置scala和Java版本?

[英]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 我的sbt项目基于以下布局: 混淆了如何设置多项目sbt项目

How and where exactly should I set the scala and java version? 我应该如何以及在何处设置scala和java版本?

I'm currently have problems with java versions when deploying so I need to be more explicit about it. 我目前在部署Java版本时遇到问题,因此我需要对其进行更明确的说明。

Easiest is to add this to Commons.settings ( scalaVersion := "2.11.1" ). 最简单的方法是将其添加到Commons.settingsscalaVersion := "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. 我不确定您如何设置Java版本。 But there's a post about it 但是有一篇关于它的文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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