播放2.3子项目依赖

时间:2014-06-24 16:33:29

标签: playframework-2.2 playframework-2.3

这是我在Play 2.3中配置子项目的方法。但是,它给了我sbt.ResolveException:未解析的依赖项。我的设置有什么问题?这适用于2.2。

    val model = Project(appName + "-model", file("models")).enablePlugins(play.PlayScala).settings(
      version := appVersion,
      libraryDependencies ++= modelDependencies          
    )

    val main = Project(appName, file(".")).enablePlugins(play.PlayScala).enablePlugins(SbtWeb).settings(
      version := appVersion,
      libraryDependencies ++= appDependencies
    ).dependsOn(model % "test->test;compile->compile")

1 个答案:

答案 0 :(得分:1)

试试这个:

  lazy val model = Project(
    id = s"${appName}-model", 
    base = file("models"))
    .enablePlugins(play.PlayScala)
    .settings(version := appVersion)
    .settings(scalaVersion := "2.11.1" )
    .settings(libraryDependencies ++= modelDependencies)

  lazy val main = Project(
    id = appName,
    base = file("webapp"))
    .enablePlugins(play.PlayScala)
    .enablePlugins(SbtWeb)
    .settings(name := "play-scala")
    .settings(version := appVersion)
    .settings(scalaVersion := "2.11.1" )
    .settings(libraryDependencies ++= appDependencies)
    .dependsOn(model % "test->test;compile->compile")

  override def rootProject = Some(main)