Flink-1.9.1-CDH6.3.2源码编译

Flink-1.9.1-CDH6.3.2源码编译

一、下载两个Tag包
在这里插入图片描述
tar包下载链接如下:

链接:https://pan.baidu.com/s/1fV3X7FVgXPOBQtCG-vbkfw
提取码:b51m
二、修改maven的setting文件(此步骤很重要,不正确设置会导致相关依赖下载错误!切记!!!)

    
        <!-- 阿里云仓库 -->
        
            alimaven</id>
            aliyun maven</name>
            http://maven.aliyun.com/nexus/content/repositories/central/</url>
            central</mirrorOf>
        </mirror>
        
            nexus-aliyun</id>
            aliyun maven</name>
            http://maven.aliyun.com/nexus/content/groups/public/</url>
            central</mirrorOf>
        </mirror>
        <!-- Maven中央仓库中国镜像 -->
        
            maven cn repo</id>
            oneof the central mirrors in china</name>
            http://maven.net.cn/content/groups/public/</url>
            central</mirrorOf>
        </mirror>
        
            maven repo</id>
            Maven Repository Switchboard</name>
            http://repo1.maven.org/maven2/</url>
            central</mirrorOf>
        </mirror>
        
            maven repo2</id>
            central</mirrorOf>
            Human Readable Name for this Mirror.</name>
            http://repo2.maven.org/maven2/</url>
        </mirror>
    </mirrors>

三、编译flink-shaded

  1. 修改 flink-shaded-7.0 的pom.xml
    添加 cloudera repository
    
        
            cloudera repo</id>
            https://repository.cloudera.com/artifactory/cloudera-repos/</url>
        </repository>
        
            mvn repo</id>
            https://mvnrepository.com</url>
        </repository>
    </repositories>
  1. 修改 flink-shaded-hadoop-2-uber 的 pom.xml

    commons-cli</groupId>
    commons-cli</artifactId>
    1.3.1</version>
</dependency>

3.进入 flink-shaded-7.0 目录,执行编译命令==(切记一定要进去flink-shaded-7.0目录下执行命令,否则会报没有pom文件的错误)==

mvn -T10C clean install -Dhadoop.version=3.0.0-cdh6.3.2

(此处的-T10C指的是10个线程)
Flink-1.9.1-CDH6.3.2源码编译_第1张图片
四、结束后编译flink1.9.1

  1. 修改 flink-1.9.1 的 pom 文件,或者不修改,直接指定-Pvendor-repos自动下载依赖pom
    
        
            cloudera repo</id>
            https://repository.cloudera.com/artifactory/cloudera-repos/</url>
        </repository>
        
            mvn repo</id>
            https://mvnrepository.com</url>
        </repository>
        
            vdc</id>
            http://nexus.saas.hand-china.com/content/repositories</url>
        </repository>
        
            horton-works-releases</id>
            http://repo.hortonworks.com/content/groups/public/</url>
        </repository>
    </repositories>

2.修改 flink-1.9.1/flink-yarn/下的pom.xml文件
vim flink-1.9.1/flink-yarn/pom.xml

    
        org.apache.maven.plugins</groupId>
        maven-compiler-plugin</artifactId>
        3.8.0</version>
        
            ${java.version}</source>
            ${java.version}</target>
            true</skip>
            <!-- The semantics of this option are reversed, see MCOMPILER-209. -->
            false</useIncrementalCompilation>
            
                <!-- Prevents recompilation due to missing package-info.class, see MCOMPILER-205 -->
                -Xpkginfo:always</arg>
            </compilerArgs>
        </configuration>
    </plugin>

3.执行编译命令==(同样此命令一定要在flink-1.9.1/目录下执行)==

mvn -T10C clean package -DskipTests -Pvendor-repos -Dhadoop.version=3.0.0-cdh6.3.2 -Dscala-2.11 -Pinclude-hadoop

4.编译成功截图

Flink-1.9.1-CDH6.3.2源码编译_第2张图片
Flink-1.9.1-CDH6.3.2源码编译_第3张图片Flink-1.9.1-CDH6.3.2源码编译_第4张图片

你可能感兴趣的:(Flink-1.9.1-CDH6.3.2源码编译)