6

我想尝试 kafka 0.8(据我所知它已经发布)。但是我在哪里可以找到 kafka maven 存储库。

我应该添加哪些额外的存储库 url?

我发现了一些博客

 <dependency>
    <groupId>org.apache.kafka</groupId>
    <artifactId>kafka_2.8.0</artifactId>
    <version>0.8.0-SHA</version>
 </dependency>

但它不起作用。我正在寻找适当的 Maven 依赖项。或者我应该从 git 中签出它并部署在我们的内部工件中?

4

7 回答 7

7

更新

自 2013 年 11 月起,可以在公共 Maven 存储库中找到官方 Kafka 版本,2015 年 3 月的最新版本是0.8.2.1

<dependency>
  <groupId>org.apache.kafka</groupId>
  <artifactId>kafka_2.10</artifactId>
  <version>0.8.2.1</version>
</dependency>

如果您创建了not.released:kafka下面详述的工件,则可以将其从本地存储库中删除。


原始答案

Kafka 尚未发布到公共 Maven 存储库,但您可以使用install-file 命令手动将其添加到本地 Maven 存储库:

mvn install:install-file -Dpackaging=jar -DgroupId=not.released
    -DartifactId=kafka -Dversion=0.8.0 -Dfile=kafka.jar

上面的命令行需要kafka.jar当前工作目录中的文件。安装后,您可以使用它:

<dependency>
  <groupId>not.released</groupId>
  <artifactId>kafka</artifactId>
  <version>0.8.0</version>
</dependency>

一旦他们发布 Kafka,您只需更改 POM 中的依赖项并从本地存储库中删除/卸载此文件。

于 2013-06-11T06:38:32.433 回答
6

截至 2013 年 12 月,Kafka 0.8 Final 已发布,可在以下定义下使用:

<dependency>
  <groupId>org.apache.kafka</groupId>
  <artifactId>kafka_2.10</artifactId>
  <version>0.8.0</version>
</dependency>
于 2013-12-10T01:34:32.080 回答
3
    <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka_2.9.2</artifactId>
        <version>0.8.0-beta1</version>
    </dependency>
于 2013-08-14T13:17:45.743 回答
2

Even though this is already answered, I think future readers might benefit from a complete simple example that works out of the box. I put one together here > https://github.com/buildlackey/cep

Like the o.p., I have been fighting to find a Maven pom.xml recipe that will allow me to pull in an official version of Kafka from a public Maven repository. I did manage to get my example working, but for now I have had to hack my dependencies so that the version of Kafka I use is pulled from a work-in-progress version of a storm-kafka integration project. I'm concerned the 'wip' versions below will be deprecated. Then this project will lose its dependencies and fail to build properly. Also, I really shouldn't be introducing storm for this simple Kafka example at this point in any case.

   
        storm
        storm
        0.9.0-wip17
    
    
        storm
        storm-core
        0.9.0-wip17
    
    
        storm
        storm-kafka
        0.9.0-wip16a-scala292
    
    


If someone could provide me with a patch for 'the right way' to do this with Maven I will update my project accordingly.... Hopefully it will serve as a useful resource for other beginning Kafka developers.

于 2013-10-22T22:48:02.167 回答
1

只需转到http://mvnrepository.com/artifact/org.apache.kafka并从列表中选择与您的版本匹配的 kafka 存储库。

于 2014-04-10T00:16:17.837 回答
0

你可以在这里找到所有的发布版本:

http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.apache.kafka%22

于 2014-05-27T14:53:27.503 回答
-1

这是另一个线索:

<dependency>
    <groupId>com.sksamuel.kafka</groupId>
    <artifactId>kafka_2.10</artifactId>
    <version>0.8.0-beta1</version>
</dependency>
于 2013-10-21T20:36:06.070 回答