【问题标题】:How to get sbteclipse working with Scala 2.9如何让 sbteclipse 与 Scala 2.9 一起工作
【发布时间】:2011-10-25 09:32:15
【问题描述】:

我正在玩喷雾模板项目和 Scala 2.9.0.1。

我想使用 Eclipse,所以我在 build.sbt 文件中添加了以下几行 喷雾模板项目。

resolvers += {
  val typesafeRepoUrl = new java.net.URL("http://repo.typesafe.com/typesafe/releases")
  val pattern = Patterns(false, "    [organisation]/[module]/[sbtversion]/[revision]/[type]s/[module](-[classifier])-[revision].    [ext]")
  Resolver.url("Typesafe Repository", typesafeRepoUrl)(pattern)
}

libraryDependencies <<= (libraryDependencies, sbtVersion) { (deps, version) => 
   deps :+ ("com.typesafe.sbteclipse" %% "sbteclipse" % "1.3-RC2" extra("sbtversion" ->    version))
}

我总是收到这个错误:

com.typesafe.sbteclipse#sbteclipse_2.9.0-1;1.3-RC2:未找到

当然,类型安全服务器上的目录不存在。只有: http://repo.typesafe.com/typesafe/releases/com.typesafe.sbteclipse/sbteclipse_2.8.1/ 但 sbt 试图得到:

http://repo.typesafe.com/typesafe/releases/com.typesafe.sbteclipse/sbteclipse_2.9.0-1/0.10.1/1.3-RC2/jars/sbteclipse_2.9.0-1-1.3-RC2.jar

我发现 2.8.1 是 sbt 内部使用的 scala 版本。但我的 sbt 版本 (0.10) 使用 build.sbt (scalaVersion := "2.9.0-1") 中设置的 scala 版本来构建下载 sbteclipse 的 url。

有人知道如何正确设置吗?如何告诉 build.sbt 文件我想使用 Scala 2.9 但要在正确的 URL 上查找 sbteclipse 插件?

是否有任何计划在 sbt 标准发行版中包含类似 sbteclipse 的内容?这将非常受欢迎,并且可能会帮助很多 Scala、sbt 和 Eclipse 的初学者。

克劳斯

【问题讨论】:

    标签: eclipse scala sbt


    【解决方案1】:

    尝试类似 "com.typesafe.sbteclipse" % "sbteclipse_2.8.1" % "1.3-RC2 ....."
    使用 "%%" 将自动将 scala 版本添加到库名称中。使用“%”不会。

    【讨论】:

    • 太棒了!标记我的答案,可以吗?
    【解决方案2】:

    还有一种更短的方法可以让 sbteclipse 投入使用。使用以下内容创建文件~/.sbt/plugins/plugins.sbt

    addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0")

    【讨论】:

      猜你喜欢
      • 2023-02-02
      • 2015-06-25
      • 2012-05-03
      • 1970-01-01
      • 2017-06-25
      • 2020-12-13
      • 2012-02-02
      • 2011-02-22
      • 2013-03-24
      相关资源
      最近更新 更多