实际情况
我想使用Apache和。就像我没有使用Java和Maven的经验一样,我试图总结我遵循的步骤和结果。
问题
如果您想使用Kinesis连接器,您不能像其他连接器那样使用ASL许可证,而且它们也不会将工件部署到Flink版本上的Maven中央存储库,因此您需要自己构建Kinesis连接器,从这里Apache Flink下载连接器的源代码,并将其安装到本地Maven存储库中。
下载后,您将按照下面的步骤构建模块
mvn clean install -Pinclude-kinesis -DskipTests因此,我移到解压缩文件夹,并运行mvn命令,有以下错误:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 50.670 s
[INFO] Finished at: 2018-12-27T14:35:13+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.rat:apache-rat-plugin:0.12:check (default) on project flink-parent: Too many files with unapproved license: 2 See RAT report in: C:\Users\...\flink-master\target\rat.txt -> [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/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :flink-parent为了找到一个解决方案,我尝试了这个用户所说的这里
mvn clean install -Pinclude-kinesis -DskipTests -Drat.ignoreErrors=true package但是,我又犯了一个错误:
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:15 min
[INFO] Finished at: 2018-12-27T14:40:47+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project flink-shaded-hadoop2: Could not resolve dependencies for project org.apache.flink:flink-shaded-hadoop2:jar:1.8-SNAPSHOT: Could not find artifact jdk.tools:jdk.tools:jar:1.6 at specified path C:\Program Files\Java\jdk-11/../lib/tools.jar -> [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
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :flink-shaded-hadoop2问题
发布于 2020-01-14 14:11:02
在收到类似的错误后,即使在使用另一个答案的解决方案签出一个发布分支之后,我也找到了一个对我有用的解决方案。根据Flink文档中的建造指南,还可以添加-Dfast选项以加快构建时间。在我的例子中,这解决了授权错误:
mvn clean install -Pinclude-kinesis -DskipTests -Dfast发布于 2018-12-27 14:25:16
我认为问题在于您正在尝试构建Flink连接器的“快照”构建,而不是版本构建。
由于您不熟悉Java和Maven,所以这意味着: Maven区分当前正在积极开发的“快照”构建和“发布”构建。通常,项目只将其发布版本推送到Maven Central。然而,对于长期运行的开发,“主”分支通常是一个快照。
链接指令中的POM引用1.6.2版本,所以这就是您应该构建的版本。请查看标记release-1.6.2,并确保您正在阅读该版本的Flink文档(上面的链接是最新开发版本的链接)。
https://stackoverflow.com/questions/53946158
复制相似问题