1. 从官网下载flink源码
https://mirror.bit.edu.cn/apache/flink/flink-1.10.0/flink-1.10.0-src.tgz
2. 解压
tar -zxvf flink-1.10.0-src.tgz
3.从idea中导入源码
4.到flink根目录下执行一下指令
$ mvn archetype:generate
5. 当出现以后提示
Define value for property 'groupId': org.apache.flink
Define value for property 'artifactId': flink-quickstart-java
Define value for property 'version' 1.0-SNAPSHOT: : 1.8.0
Define value for property 'package' org.apache.flink: : com.panda
Confirm properties configuration:
groupId: org.apache.flink
artifactId: flink-quickstart-java
version: 1.8.0
package: com.panda
出现一下界面,说明编译成功
6 编译中遇到的问题
Maven Error: Too many files with unapproved license
在mvn命令中加上-Drat.skip=true进行编译即可
Could not resolve dependencies for project org.apache.flink:flink-oss-fs-hadoop:jar:1.10.0:
mvn clean install -Dmaven.test.skip=true -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true -Drat.skip=true
maven编译问题
问题:Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.4.2:check (spotless-check) on project flinkx-core: The following files had format violations:
解决方法:编译之前先执行:mvn spotless:apply
[
](https://blog.csdn.net/weixin_42144283/article/details/122067295)
编译指令:
mvn clean install -DskipTests -Dfast