play框架:使用冲突的跨版本后缀解决模块

时间:2014-12-16 09:30:35

标签: scala playframework elasticsearch playframework-2.3 scala-2.11

我想在播放框架中使用弹性搜索,所以我按照this guide

这是我的build.sbt文件

name := """es-with-play"""

version := "1.0-SNAPSHOT"

lazy val root = (project in file(".")).enablePlugins(PlayScala)

scalaVersion := "2.11.1"

libraryDependencies ++= Seq(
  jdbc,
  anorm,
  cache,
  ws,
  "com.clever-age" % "play2-elasticsearch" % "1.4-SNAPSHOT"
)

resolvers +=   "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"

在编译代码时,在编译代码时会出现以下错误

[error] Modules were resolved with conflicting cross-version suffixes in {file:/media/sara/New%20Volume/programs/programs/play/es-with-play/}root:
[error]    com.jsuereth:scala-arm _2.11, _2.10
[error]    com.typesafe.play:play-functional _2.11, _2.10
[error]    com.typesafe.akka:akka-actor _2.11, _2.10
[error]    com.typesafe.play:play-json _2.11, _2.10
[error]    com.typesafe.play:play _2.11, _2.10
[error]    com.typesafe.play:play-iteratees _2.11, _2.10
[error]    com.typesafe.akka:akka-slf4j _2.11, _2.10
[error]    org.scala-stm:scala-stm _2.11, _2.10
[error]    com.typesafe.play:play-datacommons _2.11, _2.10
[trace] Stack trace suppressed: run last *:update for the full output.
[error] (*:update) Conflicting cross-version suffixes in: com.jsuereth:scala-arm, com.typesafe.play:play-functional, com.typesafe.akka:akka-actor, com.typesafe.play:play-json, com.typesafe.play:play, com.typesafe.play:play-iteratees, com.typesafe.akka:akka-slf4j, org.scala-stm:scala-stm, com.typesafe.play:play-datacommons
[error] Total time: 10 s, completed Dec 16, 2014 2:22:39 PM

我正在使用play 2.3和scala版本是2.11.1和elasticsearch-1.4.1 请帮帮我怎样才能解决这个错误

1 个答案:

答案 0 :(得分:3)

您正在使用Play 2.3,但play2-elasticsearch 1.4的github page状态仅与Play 2.2兼容。此外,似乎还没有针对Scala 2.11编译的版本(参见this issue)。 所以,我想你需要降级到Play 2.2.1和Scala 2.10,或者尝试使用排除来尝试github问题中提到的解决方法。