Title

Flink如何编译,版本1.12.5

1 前置版本选择

名称 版本
Flink 1.12.5
JDK jdk8_281
Maven 3.6.3

1.2 Maven编译所用的settings

<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <mirrors>
        <!-- <mirror>
            <id>mirror</id>
            <mirrorOf>!rdc-releases,!rdc-snapshots</mirrorOf>
            <name>mirror</name>
            <url>http://maven.aliyun.com/nexus/content/groups/public</url>
        </mirror> -->
		<mirror>
			<id>nexus-aliyun</id>
			<mirrorOf>*,!jeecg,!jeecg-snapshots,!mapr-releases,!confluent</mirrorOf>
			<name>Nexus aliyun</name>
			<url>http://maven.aliyun.com/nexus/content/groups/public</url>
		</mirror>
		<mirror>
		  <id>mapr-public</id>
		  <mirrorOf>mapr-releases</mirrorOf>
		  <name>mapr-releases</name>
		  <url>https://maven.aliyun.com/repository/mapr-public</url>
		</mirror>
    </mirrors>
	
	<servers>
        <server>
            <id>rdc-releases</id>
            <username>qQYXR5</username>
            <password>nV7g4WsFuQ</password>
        </server>
        <server>
            <id>rdc-snapshots</id>
            <username>qQYXR5</username>
            <password>nV7g4WsFuQ</password>
        </server>
    </servers>

    <profiles>
        <profile>
            <id>nexus</id>
            <repositories>
                <repository>
                    <id>central</id>
                    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>snapshots</id>
                    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>rdc-releases</id>
                    <url>https://repo.rdc.aliyun.com/repository/107061-release-T5BkKR/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>rdc-snapshots</id>
                    <url>https://repo.rdc.aliyun.com/repository/107061-snapshot-dVxDss/</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </repository>
                <repository>
                    <id>confluent</id>
                    <url>http://packages.confluent.io/maven/</url>
                </repository>
            </repositories>
            <pluginRepositories>
                <pluginRepository>
                    <id>central</id>
                    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </pluginRepository>
                <pluginRepository>
                    <id>snapshots</id>
                    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
                <pluginRepository>
                    <id>rdc-releases</id>
                    <url>https://repo.rdc.aliyun.com/repository/107061-release-T5BkKR/</url>
                    <releases>
                        <enabled>true</enabled>
                    </releases>
                    <snapshots>
                        <enabled>false</enabled>
                    </snapshots>
                </pluginRepository>
                <pluginRepository>
                    <id>rdc-snapshots</id>
                    <url>https://repo.rdc.aliyun.com/repository/107061-snapshot-dVxDss/</url>
                    <releases>
                        <enabled>false</enabled>
                    </releases>
                    <snapshots>
                        <enabled>true</enabled>
                    </snapshots>
                </pluginRepository>
            </pluginRepositories>
        </profile>
    </profiles>
    <activeProfiles>
        <activeProfile>nexus</activeProfile>
    </activeProfiles>
</settings>

2 下载地址

github-Flink

华为镜像

3 编译命令

3.1 格式化

mvn spotless:apply

3.2 编译

官网提供的命令是:

mvn clean install -DskipTests -Dfast

我是用的是:

mvn clean install -Dmaven.javadoc.skip=true  -DskipTests  -Dcheckstyle.skip=true  -Drat.skip=true

image-20211117135856453

4 编译结果

image-20211117140002312

5 编译过程遇到的问题

我在构建flink-runtime-web模块时出错,而我不需要,所以注释掉了

image-20211117140421183

5.2 各类jar找不到,下载不到

可以直接去https://mvnrepository.com下载,用maven命令将jar包移动到本地repository中

mvn install:install-file -Dfile=jar包的位置(参数一) -DgroupId=groupId(参数二) -DartifactId=artifactId(参数三) -Dversion=version(参数四) -Dpackaging=jar
posted @ 2021-11-17 14:20  apeGcWell  阅读(185)  评论(0编辑  收藏  举报