resolvers not shared to dependent sbt projects?

ⅰ亾dé卋堺 提交于 2019-12-21 20:53:09

问题


In this weird case that seems to involve xsbt-web-plugin, I get the error

unresolved dependency: play#play-json_2.10;2.2-SNAPSHOT: not found

when loading the server subproject. The dependency and the correct resolver are specified in the library subproject, which server depends on. It doesn't blow up if I don't include webSettings in server, but I am trying to build a .war there.

[root]/project/Build.scala

import sbt._
import Keys._

object MyBuild extends Build {
  lazy val root = Project("root", base = file(".")).aggregate(library,server)

  lazy val library = Project(id = "library", base = file("library"))

  lazy val server = Project(id = "server", base = file("server")).dependsOn(library)
}

[root]/project/plugins.sbt

// p.s. why do I need this here instead of [root]/server/project/plugins.sbt?
addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "0.3.0")

[root]/library/build.sbt

scalaVersion := "2.10.1"

libraryDependencies += "play" %% "play-json" % "2.2-SNAPSHOT"

resolvers += "Mandubian repository snapshots" at "https://github.com/mandubian/mandubian-mvn/raw/master/snapshots/"

[root]/server/build.sbt

scalaVersion := "2.10.1"

seq(webSettings :_*)

回答1:


You can use resolvers in ThisBuild += ... to make a resolver available to any sub project of your build. (That would go into [root]/build.sbt.)



来源:https://stackoverflow.com/questions/17177799/resolvers-not-shared-to-dependent-sbt-projects

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