如何构建和使用flink

如何构建和使用flink

本文介绍了如何构建和使用flink-connector-kinesis?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Apache Flink与AWS kinesis结合使用. 文档说,我必须自己建立连接器.

I'm trying to use Apache Flink with AWS kinesis. The document says that I have to build the connector on my own.

因此,我建立了连接器并为我的项目添加了jar文件,并且还将依赖项放在了pom.xml文件中.

Therefore, I build the connector and added the jar file for my project and also, I put the dependency on my pom.xml file.

<dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-connector-kinesis_2.11</artifactId>
    <version>1.6.1</version>
</dependency>

但是,当我尝试使用mvn clean package进行构建时,出现了这样的错误消息

However, when I tried to build using mvn clean package I got an error message like this

[INFO] -----------------------< kkaldk:flink-kinesis >-----------------------
[INFO] Building Flink Quickstart Job 0.1
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.apache.flink:flink-connector-kinesis_2.11:jar:1.6-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.458 s
[INFO] Finished at: 2018-12-19T17:45:43+09:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project flink-kinesis: Could not resolve dependencies for project kkaldk:flink-kinesis:jar:0.1: Failure to find org.apache.flink:flink-connector-kinesis_2.11:jar:1.6-SNAPSHOT in https://repository.apache.org/content/repositories/snapshots/ was cached in the local repository, resolution will not be reattempted until the update interval of apache.snapshots has elapsed or updates are forced ->
[Help 1]
[ERROR]

您能帮我解决这个问题吗?

Could you help me to fix this?

---------添加----------

---------added----------

这就是我所做的(这是错误的过程)

This is what I've done (which is wrong procedure)

  1. 根据此文档
  2. 通过 flink主源(它是1.8快照)
  3. 构建连接器
  4. 添加1.6.1版本的依赖项.
  1. started project following this document
  2. build connector from flink master source (which is 1.8-snapshot)
  3. add dependency with 1.6.1 version.


推荐答案

这是我为解决方案所做的.

This is what I've done for solution.

  1. 我从此处.

解压缩文件(存档将在.../flink-release-1.6.1/

unzip the file (the archive will be unzip in .../flink-release-1.6.1/

mvn clean install -Pinclude-kinesis -DskipTests

然后我的本地Maven存储库中有flink-connector-kinesis_2.11版本1.6.1

Then I have flink-connector-kinesis_2.11 version 1.6.1 in my local maven repository

(对我来说,路径是这样的):~/.m2/repository/org/apache/flink/flink-connector-kinesis_2.11

(for me, path was like this): ~/.m2/repository/org/apache/flink/flink-connector-kinesis_2.11

然后,通过在此项目中添加依赖项,我可以在任何项目中使用此连接器. (我不必再添加jar文件.)

After then, I could use this connector at any project by adding dependency with this code. (I don't have to add the jar file anymore.)

<dependency>
    <groupId>org.apache.flink</groupId>
    <artifactId>flink-connector-kinesis_2.11</artifactId>
    <version>1.6.1</version>
</dependency>

这篇关于如何构建和使用flink-connector-kinesis?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!