如何让 sbteclipse 与 Scala 2.9 一起工作

发布于 2024-11-29 02:02:33 字数 1275 浏览 1 评论 0原文

我正在使用 Spray 模板项目和 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: not found

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

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

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

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

克劳斯

I am playing with the spray template project and Scala 2.9.0.1.

I want to work with Eclipse and so I've added the following lines to the build.sbt file
of the spray template project.

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))
}

I always get this error:

com.typesafe.sbteclipse#sbteclipse_2.9.0-1;1.3-RC2: not found

Of course the directory at the typesafe server does not exist. There is only:
http://repo.typesafe.com/typesafe/releases/com.typesafe.sbteclipse/sbteclipse_2.8.1/
but sbt is trying to get:

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

I figured out that 2.8.1 is the scala version sbt uses internaly. But my
sbt version (0.10) uses the scala version set in the build.sbt (scalaVersion := "2.9.0-1") to build the url to download sbteclipse.

Does anyone know how to set this up correctly? How do I tell the build.sbt file that I want to use Scala 2.9 but to look for the sbteclipse plugin at the correct URL?

Are there any plans to include something like sbteclipse to the sbt standard distribution? That would be more than welcome and probably help a lot of beginners with Scala, sbt and Eclipse.

Claus

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

Oo萌小芽oO 2024-12-06 02:02:34

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

try some thing like "com.typesafe.sbteclipse" % "sbteclipse_2.8.1" % "1.3-RC2....."
using "%%" will automicly add scala version to the library name. using "%" will not.

坏尐絯℡ 2024-12-06 02:02:34

还有一种更短的方法来使用 sbteclipse。创建一个包含以下内容的文件 ~/.sbt/plugins/plugins.sbt

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

There is also a shorter way to get sbteclipse into use. Create a file ~/.sbt/plugins/plugins.sbt with this content:

addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.1.0")
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文