sbt.ResolveException:未解决的依赖项:org.glassfish.hk2#hk2-utils; 2.22.2:找不到

时间:2018-12-27 09:13:30

标签: scala apache-spark playframework apache-kafka sbt

我是Play框架的新手。

我试图在build.sbt中添加Spark和Kafka库,但是我得到了 此错误:

  of org.glassfish.hk2. and org.glassfish.hk2#hk2-locator;2.22.2: not 
 found and javax.validation#validation- 
  api;${javax.validation.version}: not found

每当我运行play run时,它将下载jar文件,稍后给出       Glassfish错误。 我得到的错误是

sbt error

  Here are the codes:

    name := "smack"
   version := "1.0-SNAPSHOT"

  libraryDependencies ++= Seq(
  jdbc,
 anorm,
  cache
   )     

  play.Project.playScalaSettings

  libraryDependencies ++= Seq(
   "com.datastax.cassandra"  % "cassandra-driver-core" % "2.0.2",
   jdbc,
    anorm,
     cache)

   // logging
   libraryDependencies += "org.slf4j" % "slf4j-log4j12" % "1.7.25"

   // JSON
   libraryDependencies += "com.fasterxml.jackson.module" %% "jackson- 
   module-scala" % "2.8.8"

  // Kafka
  libraryDependencies += "org.apache.kafka" % "kafka-streams" % 
  "0.10.2.0"

   libraryDependencies += "org.apache.spark" % "spark-core_2.11" % 
   "2.3.0"
  libraryDependencies += "org.apache.kafka" % "kafka-clients" % 
  "2.0.0"

我该如何解决这种依赖性问题?

1 个答案:

答案 0 :(得分:0)

我解决了错误。 我在plugins.sbt

中更改了播放版本

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

//对Play项目使用Play sbt插件

addSbtPlugin(“ com.typesafe.play”%“ sbt-plugin”%“ 2.2.6”)

并添加了

// Typesafe快照 解析器+ =“ http://repo.typesafe.com/typesafe/snapshots/处的“ Typesafe快照”

它解决了我的错误。

以供参考:

https://www.playframework.com/documentation/2.2.6/NewApplication