简体   繁体   English

用SBT下载后无法导入scalate

[英]Cannot import scalate, after downloading with SBT

my build.sbt has 我的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"

i ran 我跑了

$ sbt update

which successfully downloaded everything cf 成功下载了所有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)

but when i try to use it 但是当我尝试使用它时

$ sbt console
> import org.fusesource

the transitive dependencies hawtjni and jansi are in scope, but not scalate 传递依赖hawtjnijansi在范围内,但不是scalate

what am i doing wrong? 我究竟做错了什么?

UPDATE: 更新:

i checked for ~/.ivy2/cache/org.fusesource.scalate/ , it exists. 我检查了~/.ivy2/cache/org.fusesource.scalate/ ,它存在。

ANSWER: 回答:

solved by sbt 0.11.1 doesn't retrieve scalatra 2.1.0-SNAPSHOT dependency sbt 0.11.1解决不检索scalatra 2.1.0-SNAPSHOT依赖

Try this in your build.sbt: 在build.sbt中尝试这个:

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

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

I did two things: 我做了两件事:

1) Use %% not % so the Scala version is automatically appended to the artifact name. 1)使用%% not %因此Scala版本会自动附加到工件名称。 (It would also work to use % but change scalate-core to scalate-core_2.10 , assuming you're on some Scala 2.10.x version.) (它也可以使用%但是将scalate-core更改为scalate-core_2.10 ,假设您使用的是Scala 2.10.x版本。)

2) Omit the from clause. 2)省略from子句。 You don't need it if you have the resolver right. 如果您有正确的解析器,则不需要它。

After adding these settings to an empty sbt 0.13 project I see: 将这些设置添加到空的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))

Indentation added for clarity. 为清晰起见,添加了缩进。 Note that the main scalate jar was downloaded to ~/.ivy2/cache/org.fusesource.scalate/scalate-core_2.10/bundles/scalate-core_2.10-1.6.1.jar . 请注意,主要的scalate jar被下载到~/.ivy2/cache/org.fusesource.scalate/scalate-core_2.10/bundles/scalate-core_2.10-1.6.1.jar

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

... i should've checked one dir at a time, or subdirs, but i'm itching to write my bitcoin price monitor ;) ...我应该一次检查一个目录,或者子目录,但我很想写我的比特币价格监视器;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM