如何让 sbteclipse 与 Scala 2.9 一起工作
我正在使用 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:
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试一些类似“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.
还有一种更短的方法来使用 sbteclipse。创建一个包含以下内容的文件
~/.sbt/plugins/plugins.sbt
:There is also a shorter way to get sbteclipse into use. Create a file
~/.sbt/plugins/plugins.sbt
with this content: