【问题标题】:Confluent Kafka Streaming examples not workingConfluent Kafka Streaming 示例不起作用
【发布时间】:2016-07-13 21:34:11
【问题描述】:

我尝试在以下位置运行 kafka-streams 示例:https://github.com/confluentinc/examples/tree/master/kafka-streams

分支“kafka-0.10.0.0-cp-3.0.0”上的mvn compilemvn test 等命令应该“开箱即用”。

我收到一条错误消息:

$ 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

完整问题here

如何让 Kafka 流式传输示例正常工作?

【问题讨论】:

    标签: java maven streaming apache-kafka apache-kafka-streams


    【解决方案1】:

    分支“kafka-0.10.0.0-cp-3.0.0”上的 mvn compile 和 mvn test 等命令应该“开箱即用”。

    是的,他们确实这样做了——为此分支配置了一个 Travis CI 设置,可以在每次提交时验证构建。

    [WARNING] The POM for org.apache.kafka:kafka-clients:jar:0.10.1.0-SNAPSHOT is missing, no dependency information available
    

    看起来您实际上并没有使用kafka-0.10.0.0-cp-3.0.0,而只是在master 分支上运行mvn compile(这是默认分支)。只有master 分支使用Kafka 版本0.10.1.0-SNAPSHOT(尚未发布),这就是为什么——如自述文件中所述——如果你使用master,你需要运行额外的步骤。

    您使用分支kafka-0.10.0.0-cp-3.0.0 的工作流程应该是:

    $ git clone https://github.com/confluentinc/examples.git
    
    # Switch to `kafka-0.10.0.0-cp-3.0.0` branch
    $ git checkout kafka-0.10.0.0-cp-3.0.0
    
    $ cd examples/kafka-streams
    $ mvn compile
    

    注意:如果您确实想使用 master,自述文件包含有关如何构建最新 Kafka 版本 0.10.1.0-SNAPSHOT 的说明。 Roger Hoover 提到了其中一个步骤,但分步说明位于https://github.com/confluentinc/examples/tree/master/kafka-streams#apache-kafka

    顺便说一句,您似乎也修改了代码:

    [INFO] 构建 foo-bar-baz-artifact 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。希望这会有所帮助!

    【讨论】:

    • @michael-lafayette 这回答了你的问题吗?如果是,请随时接受和/或投票。
    【解决方案2】:

    在构建示例之前,您需要克隆 "trunk" branch of Apache Kafka,构建并安装它。

    ./gradlew installAll
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-03-17
      • 2017-09-12
      • 1970-01-01
      • 2020-04-11
      • 2015-10-23
      • 2015-11-29
      • 1970-01-01
      相关资源
      最近更新 更多