我试着运行Kafka流的例子:https://github.com/confluentinc/examples/tree/master/kafka-streams
命令,如 mvn compile
以及 mvn test
在分支上,“kafka-0.10.0.0-cp-3.0.0”应该是“开箱即用”。
我得到一个错误,说:
$ mvn compile
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building foo-bar-baz-artifact 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for org.apache.kafka:kafka-clients:jar:0.10.1.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.apache.kafka:kafka-streams:jar:0.10.1.0-SNAPSHOT is missing, no dependency information available
[WARNING] The POM for org.apache.kafka:kafka_2.11:jar:test:0.10.1.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.941 s
[INFO] Finished at: 2016-07-13T17:31:33-04:00
[INFO] Final Memory: 10M/122M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project foo-bar-baz-artifact: Could not resolve dependencies for project foo-bar-baz-group:foo-bar-baz-artifact:jar:1.0-SNAPSHOT: The following artifacts could not be resolved: org.apache.kafka:kafka-clients:jar:0.10.1.0-SNAPSHOT, org.apache.kafka:kafka-streams:jar:0.10.1.0-SNAPSHOT: Failure to find org.apache.kafka:kafka-clients:jar:0.10.1.0-SNAPSHOT in http://packages.confluent.io/maven/ was cached in the local repository, resolution will not be reattempted until the update interval of confluent has elapsed or updates are forced -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
完整的问题在这里。
如何让Kafka流媒体示例工作?
2条答案
按热度按时间q1qsirdb1#
在构建示例之前,需要克隆apachekafka的“trunk”分支,构建并安装它。
ie3xauqp2#
分支“kafka-0.10.0.0-cp-3.0.0”上的mvn compile和mvn test等命令应该是“开箱即用”的。
是的,他们确实这样做了--有一个为这个分支配置的travis ci安装程序,它在每次提交时验证构建。
看起来你实际上并没有使用
kafka-0.10.0.0-cp-3.0.0
但只要跑就行了mvn compile
上master
而不是分支(这是默认分支)。只有master
分支使用Kafka版本0.10.1.0-SNAPSHOT
(尚未发布),这就是为什么--如自述文件中所述--如果使用master
.使用分支的工作流
kafka-0.10.0.0-cp-3.0.0
应该是:注意:如果您确实想使用
master
,自述文件包含如何构建最新Kafka版本的说明0.10.1.0-SNAPSHOT
. 罗杰·胡佛提到了其中一个步骤,但一步一步的说明还在后面https://github.com/confluentinc/examples/tree/master/kafka-streams#apache-Kafka。顺便说一句,看起来你还修改了代码:
[信息]构建foo bar baz工件1.0-snapshot
“foo bar baz”不是代码库的一部分。因此,在基本构建设置为您工作之前,您可能需要恢复这些更改。
编辑:为了让它更有价值,我还更改了的存储库设置https://github.com/confluentinc/examples 使用
kafka-0.10.0.0-cp-3.0.0
作为新的默认分支(之前:master
)这样初学者就不会遇到和你一样的问题。这意味着,在跑步之后git clone ...
,您不需要同时运行git checkout kafka-0.10.0.0-cp-3.0.0
再切换到开箱即用分支kafka-0.10.0.0-cp-3.0.0
. 希望这有帮助!