Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unresolved Dependencies in sbt

Running my sbt build, I get the following unresolved dependencies.

[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.typesafe.play#sbt-link;2.2.0: not found
[warn]  :: com.typesafe.play#play-exceptions;2.2.0: not found
[warn]  :: com.typesafe.play#routes-compiler_2.10;2.2.0: not found
[warn]  :: com.typesafe.play#templates-compiler_2.10;2.2.0: not found
[warn]  :: com.typesafe.play#console_2.10;2.2.0: not found
[warn]  :: net.contentobjects.jnotify#jnotify;0.94: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

My project structure looks like this:

parent
 |
  --> sbtApp1
  --> playApp
  --> sbtApp2
  --> project
      --> Build.scala
      --> plugins.sbt
  --> build.sbt

My parent/project/plugins.sbt has the following: addSbtPlugin("com.typesafe.play" % "sbt-plugin" % "2.2.0")

I added the following line to parent/build.sbt, but I'm still getting the compile-time failure.

libraryDependencies += "play" % "play_2.10" % "2.1.0"

like image 497
Kevin Meredith Avatar asked Oct 18 '13 21:10

Kevin Meredith


2 Answers

Add this line to parent/project/plugins.sbt:

resolvers += "Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/"

Voilà. (How did I know? Because the Play 2.2 "Getting Started Guide" says so, http://www.playframework.com/documentation/2.2.x/NewApplication.)

I don't think you need the libraryDependencies thing.

like image 147
Seth Tisue Avatar answered Sep 20 '22 11:09

Seth Tisue


Had a problem with

sbt.ResolveException: unresolved dependency: org.fusesource.hawtjni#hawtjni-runtime;1.8: configuration not found in org.fusesource.hawtjni#hawtjni-runtime;1.8: 'master(compile)'. Missing configuration: 'compile'. It was required from org.fusesource.leveldbjni#leveldbjni;1.7 compile

On Fedora 22 the solution was as easy as:

~]$rm -rf .ivy2/ .sbt/

I've seen various answers on the internet telling people to delete the .sbt cache, but the .ivy2/ also causes a problem. If deleting those doesn't fix it, you may also try deleting the .maven2 directory. This forces ivy/gradle/maven to redownload everything. Not ideal, but it works.

like image 23
mttdbrd Avatar answered Sep 20 '22 11:09

mttdbrd