2

我最近用 Play 开始了一个新项目!框架和 Scala。我习惯于将 Squeryl 用于我的 ORM,但由于某种原因,它这次无法解决我的依赖关系(尽管它会解决其他问题,但不是 squeryl)。

唯一不同的是,我使用的计算机与以前不同(现在是 Windows,以前是 Arch),而且我使用的是 Play 2.1.1 而不是 2.1。

编辑:我也在代理后面,我认为这可能已经解决,因为我可以解决一些依赖关系,但除了代理与 sbt 搞砸之外,我看不到任何其他原因。我可以在浏览器中看到 squeryl 的 maven repo,但是 sbt 找不到它。

build.properties:

sbt.version=0.12.2

构建.scala:

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

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

4 回答 4

4

当您看到http://repo1.maven.org/maven2/org/squeryl/时 ,您将获得解决方案。

项目/项目/Build.scala

   val appDependencies = Seq(
 // Add your project dependencies here,
  jdbc,
  anorm,
  "org.squeryl" % "squeryl_2.10" % "0.9.5-6"
)
于 2013-06-07T16:18:39.307 回答
0

它最终成为我的代理在工作中的一个问题,它设置错误并且必须更正它。现在一切都很好!

于 2013-06-10T17:52:49.063 回答
0

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

更喜欢这个以隔离您的“错误”上下文:

 libraryDependencies += "org.squeryl" % "squeryl" % "0.9.5-6"
于 2013-06-06T13:24:54.663 回答
0

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

scalaVersion := "2.10.1"

解析器 += “类型安全存储库”,位于“ http://repo.typesafe.com/typesafe/releases

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

于 2013-06-06T13:26:32.020 回答