在2.10中继线上使用sbt的正确方法是什么?我尝试了显而易见的事实:
james@James-Moores-iMac:~/workspace/Deleteme3$ cat build.sbt
scalaVersion := "2.10.0-SNAPSHOT"
但是这给了:
james@James-Moores-iMac:~/workspace/Deleteme3$ sbt compile
[info] Loading global plugins from /Users/james/.sbt/plugins
[info] Set current project to default-ee38f7 (in build file:/Users/james/workspace/Deleteme3/)
[info] Updating {file:/Users/james/workspace/Deleteme3/}default-ee38f7...
[info] Resolving org.scala-lang#scala-library;2.10.0-SNAPSHOT ...
[warn] module not found: org.scala-lang#scala-library;2.10.0-SNAPSHOT
[warn] ==== local: tried
[warn] /Users/james/.ivy2/local/org.scala-lang/scala-library/2.10.0-SNAPSHOT/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.0-SNAPSHOT/scala-library-2.10.0-SNAPSHOT.pom
[warn] ==== Scala-Tools Maven2 Repository: tried
[warn] http://scala-tools.org/repo-releases/org/scala-lang/scala-library/2.10.0-SNAPSHOT/scala-library-2.10.0-SNAPSHOT.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-lang#scala-library;2.10.0-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/Users/james/workspace/Deleteme3/}default-ee38f7/*:update: sbt.ResolveException: unresolved dependency: org.scala-lang#scala-library;2.10.0-SNAPSHOT: not found
[error] Total time: 1 s, completed Mar 18, 2012 10:39:29 AM
james@James-Moores-iMac:~/workspace/Deleteme3$
尝试使用-sbt-snapshot的新sbt启动程序的建议也失败了:
james@James-Moores-iMac:/tmp/sfasdf$ sbt -sbt-snapshot compile
Detected sbt version 0.12.0-SNAPSHOT
Using /Users/james/.sbt/0.12.0-SNAPSHOT as sbt dir, -sbt-dir to override.
Getting net.java.dev.jna jna 3.2.3 ...
:: retrieving :: org.scala-sbt#boot-jna
confs: [default]
1 artifacts copied, 0 already retrieved (838kB/13ms)
Getting org.scala-sbt sbt 0.12.0-20120319-052150 ...
:: retrieving :: org.scala-sbt#boot-app
confs: [default]
38 artifacts copied, 0 already retrieved (7712kB/159ms)
Getting Scala 2.9.1 (for sbt)...
:: retrieving :: org.scala-sbt#boot-scala
confs: [default]
4 artifacts copied, 0 already retrieved (19939kB/426ms)
[info] Set current project to wand (in build file:/private/tmp/sfasdf/)
Getting Scala 2.10.0-SNAPSHOT ...
downloading http://scala-tools.org/repo-snapshots/org/scala-lang/scala-compiler/2.10.0-SNAPSHOT/scala-compiler-2.10.0-20120319.161232-290.jar ...
[SUCCESSFUL ] org.scala-lang#scala-compiler;2.10.0-SNAPSHOT!scala-compiler.jar (28525ms)
downloading http://scala-tools.org/repo-snapshots/org/scala-lang/scala-library/2.10.0-SNAPSHOT/scala-library-2.10.0-20120319.161232-293.jar ...
[SUCCESSFUL ] org.scala-lang#scala-library;2.10.0-SNAPSHOT!scala-library.jar (16869ms)
downloading http://scala-tools.org/repo-snapshots/org/scala-lang/jline/2.10.0-SNAPSHOT/jline-2.10.0-20120319.161232-290.jar ...
[SUCCESSFUL ] org.scala-lang#jline;2.10.0-SNAPSHOT!jline.jar (1674ms)
:: retrieving :: org.scala-sbt#boot-scala
confs: [default]
4 artifacts copied, 0 already retrieved (21204kB/91ms)
[info] Updating {file:/private/tmp/sfasdf/}default-59a990...
[info] Resolving org.scala-lang#scala-library;2.10.0-SNAPSHOT ...
[warn] module not found: org.scala-lang#scala-library;2.10.0-SNAPSHOT
[warn] ==== local: tried
[warn] /Users/james/.ivy2/local/org.scala-lang/scala-library/2.10.0-SNAPSHOT/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.0-SNAPSHOT/scala-library-2.10.0-SNAPSHOT.pom
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-lang#scala-library;2.10.0-SNAPSHOT: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[error] {file:/private/tmp/sfasdf/}default-59a990/*:update: sbt.ResolveException: unresolved dependency: org.scala-lang#scala-library;2.10.0-SNAPSHOT: not found
[error] Total time: 54 s, completed Mar 20, 2012 7:37:55 AM
答案 0 :(得分:4)
你不能使用SBT 0.11.0的trunk,你永远不能这样做。较新的SBT版本(0.12的快照)可以处理它。
答案 1 :(得分:4)
使用此版本的实际sbt脚本:https://raw.github.com/paulp/sbt-extras/master/sbt
使用
运行sbt -sbt-snapshot
将其添加到build.sbt文件中:
scalaVersion := "2.10.0-SNAPSHOT"
resolvers += Resolver.sonatypeRepo("snapshots")
(作为在一个地方结合几个答案的新答案添加 - 但将Daniel的答案标记为正确。)