scala – Parboiled2导致“在加载类文件’Prepender.class’时检
发布时间:2020-12-16 18:41:32 所属栏目:安全 来源:网络整理
导读:所以我过去几周一直试图使用parboiled2,它可能是添加到我一生中遇到的构建中最难的依赖.我当前的错误是编译sbt程序集)错误: [error] missing or invalid dependency detected while loading class file 'Prepender.class'.[error] Could not access type Pr
所以我过去几周一直试图使用parboiled2,它可能是添加到我一生中遇到的构建中最难的依赖.我当前的错误是编译sbt程序集)错误:
[error] missing or invalid dependency detected while loading class file 'Prepender.class'. [error] Could not access type PrependAux in package shapeless,[error] because it (or its dependencies) are missing. Check your build definition for [error] missing or conflicting dependencies. (Re-run with `-Ylog-classpath` to see the problematic classpath.) [error] A full rebuild may help if 'Prepender.class' was compiled against an incompatible version of shapeless. [error] .../Main.scala:56: could not find implicit value for parameter prepender: spray.routing.Prepender[shapeless.HNil,shapeless.::[String,shapeless.HNil]] [error] path(searchSegment / Segment)(title => get(responder(complete( [error] ^ 似乎根本不可能让Spray和Parboiled2一起玩得很好. 我已经尝试过sbt clean并删除我的目标目录.我的构建文件基本上是这样的: resolvers ++= Seq( "spray repo" at "http://repo.spray.io" ) val akkaV = "2.3.6" val sprayV = "1.3.2" libraryDependencies ++= Seq( // If I comment this line,everything works fine. "org.parboiled" %% "parboiled" % "2.0.1" withSources() withJavadoc(),// "org.scalacheck" %% "scalacheck" % "1.12.1" % "test" withSources() withJavadoc(),"org.specs2" %% "specs2-core" % "2.4.15" % "test" withSources() withJavadoc(),"org.specs2" %% "specs2-scalacheck" % "2.4.15" % "test" withSources() withJavadoc(),"org.scalaz" %% "scalaz-core" % "7.1.0" withSources() withJavadoc(),// "io.spray" %% "spray-json" % "1.3.1" withSources() withJavadoc(),"io.spray" %% "spray-can" % sprayV withSources() withJavadoc(),"io.spray" %% "spray-routing" % sprayV withSources() withJavadoc(),"io.spray" %% "spray-testkit" % sprayV % "test" withSources() withJavadoc(),// "com.typesafe.akka" %% "akka-actor" % akkaV withSources() withJavadoc(),"com.typesafe.akka" %% "akka-testkit" % akkaV % "test" withSources() withJavadoc() ) scalaVersion := "2.11.4" javaOptions ++= Seq("-target","1.8","-source","1.8") 我的sbtVersion是0.13.6,我的sbt-assembly版本是0.12.0 在升级到2.11并升级我的specs2依赖项之前,我得到了:parboiled2 and Spray cause conflicting cross-version suffixes 解决方法
如果你想使用shapeless2,你需要依靠spray-routing-shapedless2而不是spray-routing.
请参阅示例依赖性声明: https://github.com/spray/spray-template/blob/on_spray-can_1.3_shapeless2_scala-2.11/build.sbt (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |