unresolved dependency: com.typesafe.play#play-slick_2.10;0.6.0.1: not found

此生再无相见时 提交于 2019-12-02 00:31:15

问题


I am getting unresolved dependencies errors when trying to use slick or play-slick with Play Framework 2.2.2, sbt 0.13.0 and Scala 2.10.3 on Mac OS X Mavericks.

[info] Updating {file:/Users/michaelrichardson/Documents/Play/glasgowEffect/}glasgoweffect...
[info] Resolving com.typesafe.play#slick_2.10;2.0.0 ...
[warn]  module not found: com.typesafe.play#slick_2.10;2.0.0
[warn] ==== Typesafe Releases Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/com/typesafe/play/slick_2.10/2.0.0/slick_2.10-2.0.0.pom
[info] Resolving com.typesafe.play#play-slick_2.10;0.6.0.1 ...
[warn]  module not found: com.typesafe.play#play-slick_2.10;0.6.0.1
[warn] ==== Typesafe Releases Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/com/typesafe/play/play-slick_2.10/0.6.0.1/play-slick_2.10-0.6.0.1.pom
[info] Resolving org.fusesource.jansi#jansi;1.4 ...
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: com.typesafe.play#slick_2.10;2.0.0: not found
[warn]  :: com.typesafe.play#play-slick_2.10;0.6.0.1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) sbt.ResolveException: unresolved dependency: com.typesafe.play#slick_2.10;2.0.0: not found
[error] unresolved dependency: com.typesafe.play#play-slick_2.10;0.6.0.1: not found
[error] Total time: 7 s, completed Apr 27, 2014 2:58:48 PM

I have tried clearing my ivy cache, running play clean and adding different resolvers but nothing has worked.

This is the build.sbt file:

name := "Test"

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
  jdbc,
  anorm,
  cache,
  "com.typesafe.slick" %% "slick" % "2.0.0",
  "com.typesafe.play" %% "play-slick" % "0.6.0.1"
)     

play.Project.playScalaSettings

UPDATE: Looked into resolvers

[play21-osm] $ show resolvers [info] List(Typesafe Releases Repository: http://repo.typesafe.com/typesafe/releases/, Typesafe Releases: http://typesafe.artifactoryonline.com/typesafe, pk11 repo: http://pk11-scratch.googlecode.com/svn/trunk) [play21-osm] $ show externalResolvers [info] ArrayBuffer(FileRepository(local,FileConfiguration(true,None),Patterns(ivyPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/artifact.[ext]), artifactPatterns=List(${ivy.home}/local/[organisation]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/artifact.[ext]), isMavenCompatible=false)), Maven2 Local: file:/Users/mr/.m2/repository, public: http://repo1.maven.org/maven2/, Typesafe Releases Repository: http://repo.typesafe.com/typesafe/releases/, Typesafe Releases: http://typesafe.artifactoryonline.com/typesafe, pk11 repo: http://pk11-scratch.googlecode.com/svn/trunk)


回答1:


Quit Play Console, and make sure your build.sbt looks like this:

name := "Test"

version := "1.0-SNAPSHOT"

libraryDependencies ++= Seq(
  jdbc,
  anorm,
  cache,
  "com.typesafe.slick" %% "slick" % "2.0.0",
  "com.typesafe.play" %% "play-slick" % "0.6.0.1"
)

play.Project.playScalaSettings

Delete $PLAY_HOME/repository/cache/com.typesafe.slick and $PLAY_HOME/repository/cache/com.typesafe.play/play-slick_2.10. You may want to delete complete cache directory if you like to.

Run Play console again and execute update followed by compile.




回答2:


Your slick dependency has the wrong group name. It should be com.typesafe.slick instead of com.typesafe.play:

"com.typesafe.slick" %% "slick" % "2.0.0"



回答3:


Very hard to tell if this really was what fixed the problem but it is now working for me.

cd ~
brew uninstall sbt
brew uninstall play
mv .sbt .sbtold
mv .ivy2 .ivy2old
brew install sbt
brew install play
sbt
play 

sbt clean

I think that my sbt or ivy repositories had become corrupted and this resulted in them being rebuilt.



来源:https://stackoverflow.com/questions/23324322/unresolved-dependency-com-typesafe-playplay-slick-2-100-6-0-1-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!