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 下载地址
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
4 编译结果
5 编译过程遇到的问题
5.1 flink-runtime-web模块,可以注释掉(不需要的话)
我在构建flink-runtime-web
模块时出错,而我不需要,所以注释掉了
5.2 各类jar找不到,下载不到
可以直接去https://mvnrepository.com
下载,用maven命令将jar包移动到本地repository中
mvn install:install-file -Dfile=jar包的位置(参数一) -DgroupId=groupId(参数二) -DartifactId=artifactId(参数三) -Dversion=version(参数四) -Dpackaging=jar