美文网首页
flink 1.9.x 源码编译

flink 1.9.x 源码编译

作者: 百岁叶 | 来源:发表于2019-12-03 14:01 被阅读0次

    1、下载源码

    wget https://github.com/apache/flink/archive/release-1.9.1.zip
    

    2、解压

    unzip release-1.9.1.zip
    

    3、在flink的pom文件中添加如下

    <repositories>
        <repository>
            <id>cloudera</id>
            <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
        </repository>
        <repository>
            <id>mvnrepository</id>
             <url>https://mvnrepository.com</url>
        </repository>
    </repositories>
    

    4、mvn setting文件配置

       <mirror>
          <id>alimaven</id>
          <name>aliyun maven</name>
          <url>http://maven.aliyun.com/nexus/content/groups/public/</url>
          <mirrorOf>central</mirrorOf>
       </mirror>
    
    

    5、下载flink-shade的源码

    wget https://archive.apache.org/dist/flink/flink-shaded-7.0/flink-shaded-7.0-src.tgz
    
    1. 在flink-shade文件下的pom文件中添加
    <repositories>
     <repository>
         <id>cloudera</id>
         <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
     </repository>
    </repositories>
    

    7、编译flink-shade

    mvn clean install -DskipTests -Dhadoop.version=2.6.0-cdh5.14.2
    

    8、回到主文件夹进行编译

    mvn clean install -DskipTests  -Pvendor-repos -Dhadoop.version=2.6.0-cdh5.14.2 -Dmaven.javadoc.skip=true -Dcheckstyle.skip=true  -Drat.skip=true
    

    9、有PKIX path错误可尝试加上

    -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
    

    10、编译1.10.1需要编译flink-shade-9, 编译步骤如上

    wget https://archive.apache.org/dist/flink/flink-shaded-9.0/flink-shaded-9.0-src.tgz
    
    

    11 编译flink-1.10.1的flink-runtime-web时候可能存在科学上网的问题,可以修改 flink-runtime-web/pom.xml 文件,添加 nodeDownloadRoot 和 npmDownloadRoot 的信息

    <plugin>
        <groupId>com.github.eirslett</groupId>
        <artifactId>frontend-maven-plugin</artifactId>
        <version>1.6</version>
        <executions>
            <execution>
                <id>install node and npm</id>
                <goals>
                    <goal>install-node-and-npm</goal>
                </goals>
                <configuration>
                    <nodeDownloadRoot>https://registry.npm.taobao.org/dist/</nodeDownloadRoot>
                    <npmDownloadRoot>https://registry.npmjs.org/npm/-/</npmDownloadRoot>
                    <nodeVersion>v10.9.0</nodeVersion>
                </configuration>
            </execution>
            <execution>
                <id>npm install</id>
                <goals>
                    <goal>npm</goal>
                </goals>
                <configuration>
                    <arguments>ci --cache-max=0 --no-save</arguments>
                    <environmentVariables>
                        <HUSKY_SKIP_INSTALL>true</HUSKY_SKIP_INSTALL>
                    </environmentVariables>
                </configuration>
            </execution>
            <execution>
                <id>npm run build</id>
                <goals>
                    <goal>npm</goal>
                </goals>
                <configuration>
                    <arguments>run build</arguments>
                </configuration>
            </execution>
        </executions>
        <configuration>
            <workingDirectory>web-dashboard</workingDirectory>
        </configuration>
    </plugin>
    

    tips:编译1.12.1错误
    1、Failure to find io.confluent:kafka-schema-registry-client:jar:5.5.2
    解决方案: 添加仓库地址

       <repository>
            <id>confluent</id>
             <url>http://packages.confluent.io/maven</url>
        </repository>
    

    相关文章

      网友评论

          本文标题:flink 1.9.x 源码编译

          本文链接:https://www.haomeiwen.com/subject/qoycgctx.html