Play 2.3 subproject dependsOn

偶尔善良 提交于 2019-12-12 23:22:18

问题


This is how I configure the subprojects at Play 2.3. However, it gives me sbt.ResolveException: unresolved dependency. What is wrong with my settings? This works in 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:


try this:

  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) 


来源:https://stackoverflow.com/questions/24391877/play-2-3-subproject-dependson

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!