2014-06-24 82 views
1

這是我在Play 2.3中配置子項目的方式。但是,它給了我sbt.ResolveException:未解決的依賴關係。我的設置有什麼問題?這在2.2中起作用。播放2.3子項目dependsOn

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

試試這個:

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)