[英]How to build and use flink-connector-kinesis?
I'm trying to use Apache Flink with AWS kinesis. 我正在尝试使用Apache Flink和AWS kinesis。 The document says that I have to build the connector on my own. 该文件说我必须自己构建连接器。
Therefore, I build the connector and added the jar file for my project and also, I put the dependency on my pom.xml file. 因此,我构建了连接器并为我的项目添加了jar文件,并且我将依赖项放在我的pom.xml文件中。
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-kinesis_2.11</artifactId>
<version>1.6.1</version>
</dependency>
However, when I tried to build using mvn clean package
I got an error message like this 但是,当我尝试使用mvn clean package
构建时,我得到了这样的错误消息
[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) 这就是我所做的(这是错误的程序)
This is what I've done for solution. 这就是我为解决方案所做的。
unzip the file (the archive will be unzip in .../flink-release-1.6.1/
解压缩文件(存档将解压缩到.../flink-release-1.6.1/
built it by mvn clean install -Pinclude-kinesis -DskipTests
通过mvn clean install -Pinclude-kinesis -DskipTests
构建它
Then I have flink-connector-kinesis_2.11 version 1.6.1 in my local maven repository 然后我在我的本地maven存储库中有flink-connector-kinesis_2.11版本1.6.1
(for me, path was like this): ~/.m2/repository/org/apache/flink/flink-connector-kinesis_2.11
(对我来说,路径是这样的): ~/.m2/repository/org/apache/flink/flink-connector-kinesis_2.11
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.) (我不必再添加jar文件了。)
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-connector-kinesis_2.11</artifactId>
<version>1.6.1</version>
</dependency>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.