Flink compilation (including the latest Flink1.12 compilation)

1. Source code download

1. Github address (select the corresponding release version)

https://github.com/apache/flink/tree/release-1.12

2. About the choice of flink branch

It is best to use the release-xxx version, and use less tag version

3. Compilation differences between different versions of flink

Compilation differences between different versions of Flink, another document of mine

Two, compile

1. Compile command:

My maven version is 3.25, and I also used multi-threaded compilation. It just so happens that my version is also recommended by the official website to compile 3.25

cd xxxx/flink
mvn clean install -DskipTests -Dfast -T 4 -Dmaven.compile.fork=true  -Dscala-2.11

分解:
mvn clean install \
  -DskipTests \ # 跳过测试部分
  -Dfast \ # 跳过doc检查等
  -T 4 \ # 支持多处理器或者处理器核数参数,加快构建速度,推荐Maven3.3及以上
  -Dmaven.compile.fork=true #允许多线程编译,推荐maven在3.3及以上

2. The pits I walked through

(1) The flink-runtime-web package is difficult to download from the external network. You need to change the pom file under this package (what you need to do before executing the compilation command)

搜索“ci --cache-max=0 --no-save”替换为“install -registry=https://registry.npm.taobao.org --cache-max=0 --no-save”
即:install -registry=https://registry.npm.taobao.org --cache-max=0 --no-save

3. Find the compiled Flink package

Seeing BUILD SUCCESS shows that the compilation was successful.

The flink-1.12-SNAPSHOT package in the directory flink/flink-dist/target/flink-1.12-SNAPSHOT-bin is the flink package that can be run.

Guess you like

Origin blog.csdn.net/weixin_44500374/article/details/112611788