我正在按照这里的教程进行操作,并坚持使用json-lift依赖项。
这是我的plugings.sbt文件中的依赖项:
addSbtPlugin("net.liftweb" %% "lift-json" % "2.4")
错误在下面,它似乎与 scala 10.2 不兼容有关,但有人知道我可以让 lift-json 与 scala 10.2 一起工作的方法吗?
haknick '~/Projects/NickProjects/sometryouts/myscalatrys/scalatra/live-aq-first' --> scala -version
Scala code runner version 2.10.2 -- Copyright 2002-2013, LAMP/EPFL
haknick '~/Projects/NickProjects/sometryouts/myscalatrys/scalatra/live-aq-first' --> scala -version
Scala code runner version 2.10.2 -- Copyright 2002-2013, LAMP/EPFL
haknick '~/Projects/NickProjects/sometryouts/myscalatrys/scalatra/live-aq-first' --> sbt
[info] Loading project definition from /Users/kreshnikmati/Projects/NickProjects/sometryouts/myscalatrys/scalatra/live-aq-first/project
[info] Updating {file:/Users/kreshnikmati/Projects/NickProjects/sometryouts/myscalatrys/scalatra/live-aq-first/project/}default-7238ba...
[info] Resolving net.liftweb#lift-json;2.5 ...
[warn] module not found: net.liftweb#lift-json;2.5
[warn] ==== typesafe-ivy-releases: tried
[warn] http://repo.typesafe.com/typesafe/ivy-releases/net.liftweb/lift-json/scala_2.9.2/sbt_0.12/2.5/ivys/ivy.xml
[warn] ==== sbt-plugin-releases: tried
[warn] http://scalasbt.artifactoryonline.com/scalasbt/sbt-plugin-releases/net.liftweb/lift-json/scala_2.9.2/sbt_0.12/2.5/ivys/ivy.xml
[warn] ==== local: tried
[warn] /Users/kreshnikmati/.ivy2/local/net.liftweb/lift-json/scala_2.9.2/sbt_0.12/2.5/ivys/ivy.xml
[warn] ==== public: tried
[warn] http://repo1.maven.org/maven2/net/liftweb/lift-json_2.9.2_0.12/2.5/lift-json-2.5.pom
[info] Resolving org.scala-sbt#precompiled-2_10_1;0.12.3 ...
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: net.liftweb#lift-json;2.5: not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn]
[warn] Note: Some unresolved dependencies have extra attributes. Check that these dependencies exist with the requested attributes.
[warn] net.liftweb:lift-json:2.5 (sbtVersion=0.12, scalaVersion=2.9.2)
[warn]
sbt.ResolveException: unresolved dependency: net.liftweb#lift-json;2.5: not found
at sbt.IvyActions$.sbt$IvyActions$$resolve(IvyActions.scala:214)
at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:122)
at sbt.IvyActions$$anonfun$update$1.apply(IvyActions.scala:121)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:117)
at sbt.IvySbt$Module$$anonfun$withModule$1.apply(Ivy.scala:117)
at sbt.IvySbt$$anonfun$withIvy$1.apply(Ivy.scala:105)
at sbt.IvySbt.liftedTree1$1(Ivy.scala:52)
at sbt.IvySbt.action$1(Ivy.scala:52)
at sbt.IvySbt$$anon$3.call(Ivy.scala:61)
at xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:98)
at xsbt.boot.Locks$GlobalLock.xsbt$boot$Locks$GlobalLock$$withChannelRetries$1(Locks.scala:81)
at xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:102)
at xsbt.boot.Using$.withResource(Using.scala:11)
at xsbt.boot.Using$.apply(Using.scala:10)
at xsbt.boot.Locks$GlobalLock.ignoringDeadlockAvoided(Locks.scala:62)
at xsbt.boot.Locks$GlobalLock.withLock(Locks.scala:52)
at xsbt.boot.Locks$.apply0(Locks.scala:31)
at xsbt.boot.Locks$.apply(Locks.scala:28)
at sbt.IvySbt.withDefaultLogger(Ivy.scala:61)
at sbt.IvySbt.withIvy(Ivy.scala:102)
at sbt.IvySbt.withIvy(Ivy.scala:98)
at sbt.IvySbt$Module.withModule(Ivy.scala:117)
at sbt.IvyActions$.update(IvyActions.scala:121)
at sbt.Classpaths$$anonfun$work$1$1.apply(Defaults.scala:955)
at sbt.Classpaths$$anonfun$work$1$1.apply(Defaults.scala:953)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$58.apply(Defaults.scala:976)
at sbt.Classpaths$$anonfun$doWork$1$1$$anonfun$58.apply(Defaults.scala:974)
at sbt.Tracked$$anonfun$lastOutput$1.apply(Tracked.scala:35)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:978)
at sbt.Classpaths$$anonfun$doWork$1$1.apply(Defaults.scala:973)
at sbt.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:45)
at sbt.Classpaths$.cachedUpdate(Defaults.scala:981)
at sbt.Classpaths$$anonfun$47.apply(Defaults.scala:858)
at sbt.Classpaths$$anonfun$47.apply(Defaults.scala:855)
at sbt.Scoped$$anonfun$hf10$1.apply(Structure.scala:586)
at sbt.Scoped$$anonfun$hf10$1.apply(Structure.scala:586)
at scala.Function1$$anonfun$compose$1.apply(Function1.scala:49)
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
at sbt.Scoped$Reduced$$anonfun$combine$1$$anonfun$apply$12.apply(Structure.scala:311)
at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:41)
at sbt.std.Transform$$anon$5.work(System.scala:71)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:232)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
at sbt.Execute.work(Execute.scala:238)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:232)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:680)
[error] (*:update) sbt.ResolveException: unresolved dependency: net.liftweb#lift-json;2.5: not found
Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore?
如果您使用的是 scala 2.11,请将以下内容添加到 build.sbt 中:
libraryDependencies += "net.liftweb" %% "lift-json" % "2.6+"
lift-json不是插件,而是依赖项
您应该能够通过定义以下内容来使用它:
libraryDependencies += "net.liftweb" %% "lift-json" % "2.5.1"
在您的构建.sbt 文件中
使用
Scala 2.11.8 的 Sbt 文件:
name := "Basic Lift-JSON Demo"
version := "1.0"
scalaVersion := "2.11.8"
libraryDependencies += "net.liftweb" % "lift-webkit_2.11" % "3.1.0"