用于融合平台的sbt解析器

时间:2018-08-29 07:41:38

标签: scala apache-kafka sbt confluent

我无法在我的sbt中添加融合的仓库。我看着pom example,发现在Maven中添加回购的定义。

<repositories>
  <repository>
    <id>confluent</id>
    <url>https://packages.confluent.io/maven/</url>
  </repository>

  <!-- further repository entries here -->

</repositories>

和依赖项

<dependencies>

  <dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka_2.11</artifactId>
    <version>2.0.0-cp1</version>
  </dependency>

  <!-- further dependency entries here -->

</dependencies>

我用过

resolvers += Resolver.url("confluent", url("http://packages.confluent.io/maven/")) in build.sbt`

并声明为

libraryDependencies += "org.apache.kafka" % "kafka-clients" % "2.0.0-cp1"
libraryDependencies += "org.apache.kafka" %% "kafka" % "2.0.0-cp1"

我还是

::::::::::::::::::::::::::::::::::::::::::::::
[warn]  ::          UNRESOLVED DEPENDENCIES         ::
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::
[warn]  :: org.apache.kafka#kafka-clients;2.0.0-cp1: not found
[warn]  :: org.apache.kafka#kafka_2.12;2.0.0-cp1: not found
[warn]  ::::::::::::::::::::::::::::::::::::::::::::::

正确的方法是什么? 我的build.sbt

name := "kafka-Test"

version := "1.0"

scalaVersion := "2.12.3"


resolvers += Resolver.url("confluent", url("https://packages.confluent.io/maven/"))

libraryDependencies += "org.apache.kafka" % "kafka-clients" % "2.0.0-cp1"
libraryDependencies += "org.apache.kafka" %% "kafka" % "2.0.0-cp1"

1 个答案:

答案 0 :(得分:2)

问题出在您的解析器定义中。应该是:

resolvers += "confluent" at "https://packages.confluent.io/maven/"

我刚刚尝试过,它就可以了。