SBT没有解决Squeryl依赖

时间:2013-06-06 13:14:29

标签: scala playframework dependencies sbt squeryl

我最近用Play开始了一个新项目!框架和Scala。 我习惯使用Squeryl作为我的ORM,但由于某些原因它不能解决我的依赖(虽然它会解决其他问题,但不会解决问题)。

我唯一不同的地方就是我和以前的计算机不同(Windows现在,Arch之前),我使用的是Play 2.1.1而不是2.1。

编辑:我也支持代理,我认为这可能已经解决,因为我可以解决一些依赖关系,但我看不到任何其他原因,而代理正在与sbt搞砸。我可以在浏览器中看到maer repo for squeryl,但是sbt找不到它。

build.properties:

sbt.version=0.12.2

Build.scala:

val appDependencies = Seq(
// Add your project dependencies here,
  jdbc,
  "org.squeryl" %% "squeryl" % "0.9.5-6"
)

plugins.sbt:

// Comment to get more information during initialization
logLevel := Level.Warn

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

// Use the Play sbt plugin for Play projects
addSbtPlugin("play" % "sbt-plugin" % "2.1.1")

控制台:

C:\Path\To\Play\APP>play run
[info] Loading project definition from C:\Path\To\Play\APP
....
[warn]  module not found: org.squeryl#squeryl_2.10;0.9.5-6
[warn] ==== local: tried
[warn]   C:\Path\To\Play\play-2.1.1\repository\local\org.squeryl\squeryl_2.10
[warn] ==== Typesafe Releases Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/squeryl/squeryl_2.10/0.9.5-6/squeryl_2.10-0.9.5-6.po
[warn] ==== Typesafe Snapshots Repository: tried
[warn]   http://repo.typesafe.com/typesafe/snapshots/org/squeryl/squeryl_2.10/0.9.5-6/squeryl_2.10-0.9.5-6.p
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/squeryl/squeryl_2.10/0.9.5-6/squeryl_2.10-0.9.5-6.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.squeryl#squeryl_2.10;0.9.5-6: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: org.squeryl#squeryl_2.10;0.9.5-6: not found
    at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:214)
    at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:122)
    ...
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
[error] (*:update) sbt.ResolveException: unresolved dependency: org.squeryl#squeryl_2.10;0.9.5-6: not found
[warn] some of the dependencies were not recompiled properly, so classloader is not avaialable
[info] Updating {file:/C:/Path/To/Play/APP}
[warn]  module not found: org.squeryl#squeryl_2.10;0.9.5-6
[warn] ==== local: tried
[warn]   C:\Path\To\Play\play-2.1.1\repository\local\org.squeryl\squeryl_2.10
[warn] ==== Typesafe Releases Repository: tried
[warn]   http://repo.typesafe.com/typesafe/releases/org/squeryl/squeryl_2.10/0.9.5-6/squeryl_2.10-0.9.5-6.po
[warn] ==== Typesafe Snapshots Repository: tried
[warn]   http://repo.typesafe.com/typesafe/snapshots/org/squeryl/squeryl_2.10/0.9.5-6/squeryl_2.10-0.9.5-6.p
[warn] ==== public: tried
[warn]   http://repo1.maven.org/maven2/org/squeryl/squeryl_2.10/0.9.5-6/squeryl_2.10-0.9.5-6.pom
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.squeryl#squeryl_2.10;0.9.5-6: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency: org.squeryl#squeryl_2.10;0.9.5-6: not found
    at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:214)
    .....
    at java.lang.Thread.run(Unknown Source)
[error] (*:update) sbt.ResolveException: unresolved dependency: org.squeryl#squeryl_2.10;0.9.5-6: not found

4 个答案:

答案 0 :(得分:4)

当你看到http://repo1.maven.org/maven2/org/squeryl/时 你会得到解决方案。

PROJECT /项目/ Build.scala

   val appDependencies = Seq(
 // Add your project dependencies here,
  jdbc,
  anorm,
  "org.squeryl" % "squeryl_2.10" % "0.9.5-6"
)

答案 1 :(得分:0)

为了确保它不是潜在的SBT项目的配置问题,请暂时不要使用%%表示法。实际上,这个版本会自动选择与您当前的scala版本相对应的Jar版本,这可能与您期望的版本不同(在您的conf中疏忽,某些配置文件中的变量冲突等等。)

首选此选项以隔离“错误”上下文:

 libraryDependencies += "org.squeryl" % "squeryl" % "0.9.5-6"

答案 2 :(得分:0)

这是来自我的build.sbt(以及相关部分) - 什么是scala版本?

scalaVersion:=“2.10.1”

解析器+ =“Typesafe存储库”位于“http://repo.typesafe.com/typesafe/releases

libraryDependencies ++ = Seq(   “org.squeryl”%%“squeryl”%“0.9.5-6”,

答案 3 :(得分:0)

它最终成为我的代理工作的问题,它设置错误,必须纠正它。一切都很好!