解析器未共享给依赖的sbt项目? [英] resolvers not shared to dependent sbt projects?
问题描述
在这种似乎涉及xsbt-web-plugin的奇怪情况下,我得到了错误
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
在加载server
子项目时.依赖项和正确的解析器在server
依赖的library
子项目中指定.如果我在服务器中不包含webSettings
,它不会崩溃,但是我正在尝试在其中构建.war.
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
[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
[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
[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
[root]/server/build.sbt
scalaVersion := "2.10.1"
seq(webSettings :_*)
推荐答案
您可以使用resolvers in ThisBuild += ...
使解析器可用于构建的任何子项目. (这将进入[root]/build.sbt
.)
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
.)
这篇关于解析器未共享给依赖的sbt项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!