【问题标题】:Can't find kafka library in confluent repository在融合存储库中找不到 kafka 库
【发布时间】:2018-12-05 22:19:06
【问题描述】:

我使用的是confluent,根据官方文档,我只需要在pom.xml中配置如下:

<repositories>
        <repository>
            <id>confluent</id>
            <url>http://packages.confluent.io/maven/</url>
        </repository>
        <!-- further repository entries here -->
</repositories>


<dependencies>
       <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka_2.11</artifactId>
            <!-- For CP 3.1.0 -->
            <version>0.10.1.0-cp1</version>
        </dependency>
</dependencies>

但似乎 kafka_2.11 版本为 0.10.1.0-cp1 并没有退出。 网站http://packages.confluent.io/maven/ 也无法访问。 我怎样才能得到它?

【问题讨论】:

  • 请在代码中尝试使用 Kafka 库时显示运行 mvn clean compile 的输出。此外,您还需要将那里的版本更新为您的 Kafka 版本。 3.1 已经相当老了

标签: java maven apache-kafka confluent-platform


【解决方案1】:

我正在使用以下 maven 依赖,它对我来说工作正常:

   <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>connect-api</artifactId>
            <version>0.10.2.0-cp1</version>
   </dependency>



 <repository>
            <id>confluent</id>
            <name>Confluent</name>
            <url>http://packages.confluent.io/maven/</url>
 </repository>

希望这会有所帮助

【讨论】:

  • 没有错误信息。只是pom文件显示红线,提示找不到依赖。
  • 我再次验证了对我来说一切正常。因此,您面临的问题似乎与 Maven 设置或 pom 问题有关。您可以下载 jar 并使用标记 system 直接指向 pom.xml 中的该 jar
  • 谢谢。经过几个小时的解决方案,这个对我有用!
猜你喜欢
  • 1970-01-01
  • 2020-09-12
  • 2017-11-15
  • 2013-12-11
  • 1970-01-01
  • 2013-06-06
  • 2016-05-10
  • 2019-11-01
  • 1970-01-01
相关资源
最近更新 更多