java 我在哪里可以找到 kafka 的 Maven 存储库?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17037209/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
where can I find maven repository for kafka?
提问by Julias
I want to try kafka 0.8 (as I understand it is already released). But where can I find the kafka maven repository.
我想尝试 kafka 0.8(据我所知它已经发布)。但是我在哪里可以找到 kafka maven 存储库。
And what additional repository url should I add?
我应该添加什么额外的存储库 url?
I've found some blogs with
我发现了一些博客
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.8.0</artifactId>
<version>0.8.0-SHA</version>
</dependency>
but it is not works. I'm looking for proper maven dependency. Or should I checkout it from git and deploy in our internal artifactory?
但它不起作用。我正在寻找适当的 Maven 依赖项。或者我应该从 git 中检出它并部署在我们的内部工件中?
回答by Cebence
UPDATE
更新
Since November 2013 official Kafka releases can be found on public Maven repository, the latest version in March 2015 being 0.8.2.1
:
自 2013 年 11 月以来,官方 Kafka 版本可以在公共 Maven 存储库中找到,2015 年 3 月的最新版本是0.8.2.1
:
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.10</artifactId>
<version>0.8.2.1</version>
</dependency>
If you created the not.released:kafka
artifact detailed below any more you can remove itfrom the local repository.
如果您创建了not.released:kafka
下面详述的工件,则可以将其从本地存储库中删除。
Original Answer
原答案
Kafka is not released yet to a public Maven repository, but you can add it to your local Maven repository by hand with the install-file command:
Kafka 尚未发布到公共 Maven 存储库,但您可以使用install-file 命令手动将其添加到本地 Maven 存储库:
mvn install:install-file -Dpackaging=jar -DgroupId=not.released
-DartifactId=kafka -Dversion=0.8.0 -Dfile=kafka.jar
The command line above expects kafka.jar
file in the current working directory.
Once installed you can use it with:
上面的命令行需要kafka.jar
当前工作目录中的文件。安装后,您可以将其用于:
<dependency>
<groupId>not.released</groupId>
<artifactId>kafka</artifactId>
<version>0.8.0</version>
</dependency>
Once they release Kafka you can just change the dependency in your POMs and remove / uninstall this file from your local repository.
一旦他们发布了 Kafka,您就可以更改 POM 中的依赖项并从本地存储库中删除/卸载此文件。
回答by fourk
As of December 2013, Kafka 0.8 Final was released and is available under the following definition:
截至 2013 年 12 月,Kafka 0.8 Final 已发布,可在以下定义下使用:
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.10</artifactId>
<version>0.8.0</version>
</dependency>
回答by Hild
<dependency>
<groupId>org.apache.kafka</groupId>
<artifactId>kafka_2.9.2</artifactId>
<version>0.8.0-beta1</version>
</dependency>
回答by Chris Bedford
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
尽管已经回答了这个问题,但我认为未来的读者可能会从一个完整的、开箱即用的简单示例中受益。我在这里放了一个> 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.
和 op 一样,我一直在努力寻找一个 Maven pom.xml 配方,它可以让我从公共 Maven 存储库中提取正式版本的 Kafka。我确实设法让我的示例工作,但现在我不得不破解我的依赖项,以便我使用的 Kafka 版本是从 Storm-kafka 集成项目的正在进行中的版本中提取的。我担心下面的“wip”版本将被弃用。那么这个项目将失去它的依赖项并且无法正确构建。此外,在任何情况下,此时我真的不应该为这个简单的 Kafka 示例引入 Storm。
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.
如果有人可以为我提供使用 Maven 执行此操作的“正确方法”的补丁,我将相应地更新我的项目......希望它可以作为其他 Kafka 初级开发人员的有用资源。
回答by Vladimir Kroz
Just go to http://mvnrepository.com/artifact/org.apache.kafkaand choose from the list kafka repository matching to your version.
只需访问http://mvnrepository.com/artifact/org.apache.kafka并从与您的版本匹配的 kafka 存储库列表中进行选择。
回答by frank
You can find all the realease version here:
你可以在这里找到所有的 realease 版本:
http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.apache.kafka%22
http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.apache.kafka%22
回答by Alvin
Here is another clue:
这是另一个线索:
<dependency>
<groupId>com.sksamuel.kafka</groupId>
<artifactId>kafka_2.10</artifactId>
<version>0.8.0-beta1</version>
</dependency>