问题描述
在 Mac OS X Mavericks 上尝试将 slick 或 play-slick 与 Play Framework 2.2.2、sbt 0.13.0 和 Scala 2.10.3 一起使用时,我遇到了未解决的依赖关系错误.
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
我尝试清除我的 ivy 缓存,运行 play clean
并添加不同的解析器,但没有任何效果.
I have tried clearing my ivy cache, running play clean
and adding different resolvers but nothing has worked.
这是 build.sbt 文件:
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
更新:调查解析器
[play21-osm] $ 显示解析器[信息] 列表(Typesafe 发布存储库:http://repo.typesafe.com/typesafe/releases/,Typesafe 发布:http://typesafe.artifactoryonline.com/typesafe,pk11 repo:http://pk11-scratch.googlecode.com/svn/trunk)[play21-osm] $ 显示外部解析器[信息] 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 发布存储库:http://repo.typesafe.com/typesafe/releases/,Typesafe 版本:http://typesafe.artifactoryonline.com/typesafe,pk11 存储库:http://pk11-scratch.googlecode.com/svn/trunk)
[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)
推荐答案
退出 Play Console,并确保您的 build.sbt
如下所示:
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
删除 $PLAY_HOME/repository/cache/com.typesafe.slick
和 $PLAY_HOME/repository/cache/com.typesafe.play/play-slick_2.10
.如果您愿意,您可能希望删除完整的缓存目录.
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.
再次运行 Play 控制台并执行 update
,然后执行 compile
.
Run Play console again and execute update
followed by compile
.
这篇关于未解决的依赖关系:com.typesafe.play#play-slick_2.10;0.6.0.1:未找到的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!