用SBT下载后无法导入scalate

时间:2013-12-09 02:25:17

标签: sbt scalate

我的build.sbt

libraryDependencies += "org.fusesource.scalate" % "scalate-core" % "1.6.1" from "http://repo.fusesource.com/nexus/content/repositories/public/org/fusesource/scalate/"

resolvers += "FuseSource Public Repository" at "http://repo.fusesource.com/nexus/content/repositories/public"
我跑了

$ sbt update

成功下载了所有cf

[info] downloading http://repo.fusesource.com/nexus/content/repositories/public/org/fusesource/scalate/ ...
[info]  [SUCCESSFUL ] org.fusesource.scalate#scalate-core;1.6.1!scalate-core.com/nexus/content/repositories/public/org/fusesource/scalate/ (617ms)

但是当我尝试使用它时

$ sbt console
> import org.fusesource

传递依赖关系hawtjnijansi在范围内,但不在scalate

我做错了什么?

更新:

我检查了~/.ivy2/cache/org.fusesource.scalate/,它存在。

解答:

sbt 0.11.1 doesn't retrieve scalatra 2.1.0-SNAPSHOT dependency

解决

2 个答案:

答案 0 :(得分:1)

在build.sbt中尝试这个:

resolvers += "FuseSource Public Repository" at
  "http://repo.fusesource.com/nexus/content/repositories/public"

libraryDependencies +=
  "org.fusesource.scalate" %% "scalate-core" % "1.6.1"

我做了两件事:

1)使用%%而非%,以便Scala版本自动附加到工件名称。 (如果您使用的是Scala 2.10.x版本,也可以使用%但将scalate-core更改为scalate-core_2.10。)

2)省略from子句。如果您有正确的解析器,则不需要它。

将这些设置添加到空的sbt 0.13项目后,我看到:

> show fullClasspath
[info] Updating {file:/Users/tisue/foo/}foo...
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[info] downloading http://repo1.maven.org/maven2/org/fusesource/scalate/scalate-core_2.10/1.6.1/scalate-core_2.10-1.6.1.jar ...
[info]  [SUCCESSFUL ] org.fusesource.scalate#scalate-core_2.10;1.6.1!scalate-core_2.10.jar(bundle) (1265ms)
[info] downloading http://repo1.maven.org/maven2/org/fusesource/scalate/scalate-util_2.10/1.6.1/scalate-util_2.10-1.6.1.jar ...
[info]  [SUCCESSFUL ] org.fusesource.scalate#scalate-util_2.10;1.6.1!scalate-util_2.10.jar(bundle) (274ms)
[info] downloading http://repo1.maven.org/maven2/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar ...
[info]  [SUCCESSFUL ] org.slf4j#slf4j-api;1.6.1!slf4j-api.jar (198ms)
[info] Done updating.
[info] List(Attributed(/Users/tisue/foo/target/scala-2.10/classes),
            Attributed(/Users/tisue/.sbt/boot/scala-2.10.2/lib/scala-library.jar),
            Attributed(/Users/tisue/.ivy2/cache/org.fusesource.scalate/scalate-core_2.10/bundles/scalate-core_2.10-1.6.1.jar),
            Attributed(/Users/tisue/.ivy2/cache/org.fusesource.scalate/scalate-util_2.10/bundles/scalate-util_2.10-1.6.1.jar),
            Attributed(/Users/tisue/.ivy2/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.6.1.jar),
            Attributed(/Users/tisue/.ivy2/cache/org.scala-lang/scala-compiler/jars/scala-compiler-2.10.0.jar),
            Attributed(/Users/tisue/.ivy2/cache/org.scala-lang/scala-reflect/jars/scala-reflect-2.10.0.jar))

为了清晰起见,添加了缩进。请注意,主要的scalate jar已下载到~/.ivy2/cache/org.fusesource.scalate/scalate-core_2.10/bundles/scalate-core_2.10-1.6.1.jar

答案 1 :(得分:1)

nuke ~/.ivy2和/或~/.sbt和/或~/.m2

...我应该一次检查一个目录,或者子目录,但我很想写我的比特币价格监视器;)