我有一个包含一些子项目的游戏项目。 我可以在类型安全激活器的控制台中运行播放应用程序1或2 - 有选择地如下。
$ activator "project collector" run
$ activator "project scheduler" run
但是,我无法在IntelliJ中找到任何参考和手册。 我该怎么办?
项目结构是这样的。
root
- collector (play application 1)
- app
- conf
- build.sbt
- scheduler (play application 2)
- app
- conf
- build.sbt
- core
- src
- build.sbt
- util
- src
- build.sbt
- build.sbt
root的build.sbt文件如下所示。
import sbt.Keys._
lazy val commonSettings = Seq(
organization := "com.xxxx",
version := "1.0.0-SNAPSHOT",
scalaVersion := "2.11.6",
javacOptions in Compile ++= Seq("-source", "1.7", "-target", "1.7")
)
lazy val root = (project in file(".")).
aggregate(core, collector, scheduler, util).
enablePlugins(PlayScala).
settings(
name := "collector",
version := "1.0",
scalaVersion := "2.11.6"
)
lazy val core = project.in(file("core")).
settings(commonSettings: _*)
lazy val collector = project.in(file("collector")).
dependsOn(core, util).
settings(commonSettings: _*).
enablePlugins(PlayScala, SbtWeb)
lazy val scheduler = project.in(file("scheduler")).
dependsOn(core, util).
settings(commonSettings: _*).
enablePlugins(PlayScala, SbtWeb)
lazy val util = project.in(file("util")).
settings(commonSettings: _*).
dependsOn(core)
libraryDependencies ++= Seq(
"io.spray" % "spray-io_2.11" % "1.3.2",
"io.spray" % "spray-can_2.11" % "1.3.2",
"io.spray" % "spray-client_2.11" % "1.3.2",
"io.spray" % "spray-http_2.11" % "1.3.2",
"io.spray" % "spray-httpx_2.11" % "1.3.2",
"io.spray" % "spray-util_2.11" % "1.3.2",
"com.typesafe.akka" % "akka-actor_2.11" % "2.3.7",
"com.typesafe.akka" % "akka-contrib_2.11" % "2.3.7",
"com.typesafe.slick" %% "slick" % "2.1.0"
)
Keys.fork in Test := false
addCommandAlias("cc", ";clean;compile")
答案 0 :(得分:0)
答案 1 :(得分:0)
关于intellij 点击菜单
运行>编辑配置> “+”> SBT任务
点击“运行”> “跑者”
对您的其他项目重复上述步骤 参考