0

my build.sbt has

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

[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

what am i doing wrong?

UPDATE:

i checked for ~/.ivy2/cache/org.fusesource.scalate/, it exists.

ANSWER:

solved by sbt 0.11.1 doesn't retrieve scalatra 2.1.0-SNAPSHOT dependency

Community
  • 1
  • 1
sam boosalis
  • 1,997
  • 4
  • 20
  • 32

2 Answers2

1

Try this in your 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. (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.)

2) Omit the from clause. You don't need it if you have the resolver right.

After adding these settings to an empty sbt 0.13 project I see:

> 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.

Seth Tisue
  • 29,985
  • 11
  • 82
  • 149
  • thanks, but still won't import. where should i find the library? `find . | grep scalate` shows nothing. – sam boosalis Dec 09 '13 at 15:39
  • 1
    I added a transcript showing where the jars end up, and also how you would find out where they ended up. Sam's advice to nuke `~/.ivy2` is good; botched attempts to use `from` may have left bad files there. – Seth Tisue Dec 09 '13 at 16:09
  • thanks! i remember seeing stuff like "org.fusesource.scalate#scalate-core_2.10;1.6.1!..." but not like "List(Attributed(...))", i'll pay more attention next time. also, "botched" meaning i used `from` when i should not have, or i C-c'd some process, or both `from` and not `from`, or what? – sam boosalis Dec 09 '13 at 16:27
  • 1
    If you use `from` to tell sbt "dependency A is at this URL, I promise you!", then sbt will believe you, and not just believe you, but cache the retrieved artifact too. I don't think that changing the URL in a `from`, or removing the `from` entirely, triggers retrieval from the correct location of something that sbt already has in cache that is bad because it came from an incorrect location. – Seth Tisue Dec 09 '13 at 16:30
  • I would _think_ and _hope_ Ivy is robust about C-c, network going blooey, etc., but I don't know it for sure. – Seth Tisue Dec 09 '13 at 16:34
1

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

... i should've checked one dir at a time, or subdirs, but i'm itching to write my bitcoin price monitor ;)

sam boosalis
  • 1,997
  • 4
  • 20
  • 32