我在子项目中设置了我的play 2.3 app(在根intellij项目中的模块)。 sbt编译工作正常但我无法弄清楚如何在intellij中运行play子项目。我错过了什么?
我已经设置了我的解决方案文件夹结构(简化):
这是根项目build.sbt:
import sbt._
import Keys._
import play.PlayScala
name := "MyApp"
version := "1.0"
lazy val commonSettings = Seq(
organization := "com.company",
scalaVersion := "2.11.5"
)
javacOptions ++= Seq("-source", "1.7", "-target", "1.7")
libraryDependencies ++= Seq(
"com.typesafe.slick" % "slick_2.11" % "2.1.0",
"org.apache.logging.log4j" % "log4j-api" % "2.1",
"org.apache.logging.log4j" % "log4j-core" % "2.1",
"org.slf4j" % "slf4j-nop" % "1.7.10",
"com.typesafe" % "config" % "1.2.1",
"mysql" % "mysql-connector-java" % "5.1.34"
)
lazy val data = project.in(file("data"))
.settings(commonSettings: _*)
lazy val webapp = project.in(file("webapp"))
.settings(commonSettings: _*)
.enablePlugins(PlayScala, SbtWeb)
.dependsOn(data)
lazy val root = project.in(file(".")).aggregate(
webapp,
data
)
和webapp project / plugins.sbt
resolvers += "Typesafe repository" at "https://repo.typesafe.com/typesafe/releases/"
// The Play plugin
addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.3.8")
// web plugins
addSbtPlugin("com.typesafe.sbt" % "sbt-coffeescript" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-less" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-jshint" % "1.0.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-rjs" % "1.0.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-digest" % "1.0.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-mocha" % "1.0.0")