【问题标题】:resolvers not shared to dependent sbt projects?解析器不共享给依赖的 sbt 项目?
【发布时间】:2013-06-15 04:39:43
【问题描述】:

在这个似乎涉及 xsbt-web-plugin 的奇怪案例中,我得到了错误

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

加载server 子项目时。依赖关系和正确的解析器在library 子项目中指定,server 依赖于它。如果我不在服务器中包含webSettings,它不会爆炸,但我正在尝试在那里构建一个 .war。

[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")

[根]/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 :_*)

【问题讨论】:

    标签: scala sbt multi-project xsbt-web-plugin


    【解决方案1】:

    您可以使用resolvers in ThisBuild += ... 使解析器可用于您构建的任何子项目。 (这将进入[root]/build.sbt。)

    【讨论】:

      猜你喜欢
      • 2015-12-12
      • 2018-07-20
      • 2017-08-09
      • 1970-01-01
      • 2023-03-08
      • 2016-06-19
      • 2018-03-20
      • 2016-02-18
      • 1970-01-01
      相关资源
      最近更新 更多