首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Parboiled2导致“加载类文件‘Prepender.class’时检测到的”缺失或无效依赖“

Parboiled2导致“加载类文件‘Prepender.class’时检测到的”缺失或无效依赖“
EN

Stack Overflow用户
提问于 2015-01-14 11:41:13
回答 1查看 5.2K关注 0票数 5

因此,在过去的几周里,我一直在尝试使用parboiled2,这可能是我一生中遇到的最难添加到构建中的依赖。我当前的错误是编译sbt assembly)错误:

代码语言:javascript
复制
[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]                        ^

这似乎是根本不可能使喷雾和Parboiled2一起玩得很好。

我尝试过sbt clean并删除了我的target目录。我的构建文件基本上如下:

代码语言:javascript
复制
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

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-01-14 12:55:33

如果您想使用shapeless2,您需要依赖于spray-routing-shapeless2而不是spray-routing

请参阅示例依赖声明:

scala-2.11/build.sbt

票数 10
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27942110

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档