211 lines
8.9 KiB
XML
211 lines
8.9 KiB
XML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||
|
<modelVersion>4.0.0</modelVersion>
|
||
|
<groupId>org.example</groupId>
|
||
|
<artifactId>flinkcdc</artifactId>
|
||
|
<version>1.0</version>
|
||
|
<properties>
|
||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||
|
<encoding>UTF-8</encoding>
|
||
|
<java.version>1.8</java.version>
|
||
|
<flink.version>1.19.1</flink.version>
|
||
|
<scala.binary.version>2.12</scala.binary.version>
|
||
|
<mysql-cdc.version>3.0.1</mysql-cdc.version>
|
||
|
<flink-connector.version>3.2.0-1.19</flink-connector.version>
|
||
|
<slf4j.version>1.7.25</slf4j.version>
|
||
|
<lombok.version>1.18.8</lombok.version>
|
||
|
<fastjson.version>1.2.83</fastjson.version>
|
||
|
</properties>
|
||
|
|
||
|
<dependencies>
|
||
|
<!-- 编写 Flink 批处理/流处理程序 -->
|
||
|
<dependency>
|
||
|
<groupId>org.apache.flink</groupId>
|
||
|
<artifactId>flink-java</artifactId>
|
||
|
<version>${flink.version}</version>
|
||
|
</dependency>
|
||
|
<!-- 实时数据处理 -->
|
||
|
<dependency>
|
||
|
<groupId>org.apache.flink</groupId>
|
||
|
<artifactId>flink-streaming-java</artifactId>
|
||
|
<version>${flink.version}</version>
|
||
|
</dependency>
|
||
|
<!-- 提交、管理 Flink 作业 -->
|
||
|
<dependency>
|
||
|
<groupId>org.apache.flink</groupId>
|
||
|
<artifactId>flink-clients</artifactId>
|
||
|
<version>${flink.version}</version>
|
||
|
</dependency>
|
||
|
<!-- Java 与 Table API 桥接 -->
|
||
|
<dependency>
|
||
|
<groupId>org.apache.flink</groupId>
|
||
|
<artifactId>flink-table-planner_${scala.binary.version}</artifactId>
|
||
|
<version>${flink.version}</version>
|
||
|
</dependency>
|
||
|
<!-- 使用 SQL -->
|
||
|
<dependency>
|
||
|
<groupId>org.apache.flink</groupId>
|
||
|
<artifactId>flink-table-api-java-bridge</artifactId>
|
||
|
<version>${flink.version}</version>
|
||
|
</dependency>
|
||
|
|
||
|
<!-- 连接器基础库 -->
|
||
|
<dependency>
|
||
|
<groupId>org.apache.flink</groupId>
|
||
|
<artifactId>flink-connector-base</artifactId>
|
||
|
<version>${flink.version}</version>
|
||
|
</dependency>
|
||
|
<!-- 实时同步 MySQL 数据 -->
|
||
|
<dependency>
|
||
|
<groupId>com.ververica</groupId>
|
||
|
<artifactId>flink-connector-mysql-cdc</artifactId>
|
||
|
<version>${mysql-cdc.version}</version>
|
||
|
</dependency>
|
||
|
<!-- JDBC 支持 -->
|
||
|
<dependency>
|
||
|
<groupId>org.apache.flink</groupId>
|
||
|
<artifactId>flink-connector-jdbc</artifactId>
|
||
|
<version>${flink-connector.version}</version>
|
||
|
</dependency>
|
||
|
<!-- Kafka Source/Sink -->
|
||
|
<dependency>
|
||
|
<groupId>org.apache.flink</groupId>
|
||
|
<artifactId>flink-connector-kafka</artifactId>
|
||
|
<version>${flink-connector.version}</version>
|
||
|
</dependency>
|
||
|
<dependency>
|
||
|
<groupId>org.apache.flink</groupId>
|
||
|
<artifactId>flink-json</artifactId>
|
||
|
<version>${flink.version}</version>
|
||
|
</dependency>
|
||
|
<!-- MySQL JDBC 驱动 -->
|
||
|
<dependency>
|
||
|
<groupId>mysql</groupId>
|
||
|
<artifactId>mysql-connector-java</artifactId>
|
||
|
<version>8.0.33</version>
|
||
|
</dependency>
|
||
|
|
||
|
<!--日志记录-->
|
||
|
<dependency>
|
||
|
<groupId>org.slf4j</groupId>
|
||
|
<artifactId>slf4j-simple</artifactId>
|
||
|
<version>${slf4j.version}</version>
|
||
|
<scope>compile</scope>
|
||
|
</dependency>
|
||
|
|
||
|
</dependencies>
|
||
|
|
||
|
<!--打包的配置-->
|
||
|
<build>
|
||
|
<plugins>
|
||
|
<!-- Java 编译插件 -->
|
||
|
<plugin>
|
||
|
<groupId>org.apache.maven.plugins</groupId>
|
||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||
|
<version>3.1</version>
|
||
|
<configuration>
|
||
|
<source>${java.version}</source>
|
||
|
<target>${java.version}</target>
|
||
|
</configuration>
|
||
|
</plugin>
|
||
|
|
||
|
<!-- 使用 maven-shade-plugin 打包并指定 mainClass -->
|
||
|
<plugin>
|
||
|
<groupId>org.apache.maven.plugins</groupId>
|
||
|
<artifactId>maven-shade-plugin</artifactId>
|
||
|
<version>3.0.0</version>
|
||
|
<executions>
|
||
|
<!-- 在 package 阶段执行 shade 目标 -->
|
||
|
<execution>
|
||
|
<phase>package</phase>
|
||
|
<goals>
|
||
|
<goal>shade</goal>
|
||
|
</goals>
|
||
|
<configuration>
|
||
|
<!-- 排除一些不需要打包进 jar 的依赖 -->
|
||
|
<artifactSet>
|
||
|
<excludes>
|
||
|
<exclude>org.apache.flink:force-shading</exclude>
|
||
|
<exclude>com.google.code.findbugs:jsr305</exclude>
|
||
|
<exclude>org.slf4j:*</exclude>
|
||
|
<exclude>log4j:*</exclude>
|
||
|
</excludes>
|
||
|
</artifactSet>
|
||
|
|
||
|
<!-- 过滤资源文件 -->
|
||
|
<filters>
|
||
|
<filter>
|
||
|
<!-- 不要复制 META-INF 中的签名文件 -->
|
||
|
<artifact>*:*</artifact>
|
||
|
<excludes>
|
||
|
<exclude>META-INF/*.SF</exclude>
|
||
|
<exclude>META-INF/*.DSA</exclude>
|
||
|
<exclude>META-INF/*.RSA</exclude>
|
||
|
</excludes>
|
||
|
</filter>
|
||
|
</filters>
|
||
|
|
||
|
<!-- 指定 mainClass -->
|
||
|
<transformers>
|
||
|
<transformer
|
||
|
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||
|
<!-- 替换为你自己的 main 类路径 -->
|
||
|
<mainClass>src.main.java.Main</mainClass>
|
||
|
</transformer>
|
||
|
</transformers>
|
||
|
</configuration>
|
||
|
</execution>
|
||
|
</executions>
|
||
|
</plugin>
|
||
|
</plugins>
|
||
|
|
||
|
<!-- 插件管理(可选) -->
|
||
|
<pluginManagement>
|
||
|
<plugins>
|
||
|
<!-- 在 Eclipse 中忽略一些警告 -->
|
||
|
<plugin>
|
||
|
<groupId>org.eclipse.m2e</groupId>
|
||
|
<artifactId>lifecycle-mapping</artifactId>
|
||
|
<version>1.0.0</version>
|
||
|
<configuration>
|
||
|
<lifecycleMappingMetadata>
|
||
|
<pluginExecutions>
|
||
|
<pluginExecution>
|
||
|
<pluginExecutionFilter>
|
||
|
<groupId>org.apache.maven.plugins</groupId>
|
||
|
<artifactId>maven-shade-plugin</artifactId>
|
||
|
<versionRange>[3.0.0,)</versionRange>
|
||
|
<goals>
|
||
|
<goal>shade</goal>
|
||
|
</goals>
|
||
|
</pluginExecutionFilter>
|
||
|
<action>
|
||
|
<ignore/>
|
||
|
</action>
|
||
|
</pluginExecution>
|
||
|
<pluginExecution>
|
||
|
<pluginExecutionFilter>
|
||
|
<groupId>org.apache.maven.plugins</groupId>
|
||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||
|
<versionRange>[3.1,)</versionRange>
|
||
|
<goals>
|
||
|
<goal>testCompile</goal>
|
||
|
<goal>compile</goal>
|
||
|
</goals>
|
||
|
</pluginExecutionFilter>
|
||
|
<action>
|
||
|
<ignore/>
|
||
|
</action>
|
||
|
</pluginExecution>
|
||
|
</pluginExecutions>
|
||
|
</lifecycleMappingMetadata>
|
||
|
</configuration>
|
||
|
</plugin>
|
||
|
</plugins>
|
||
|
</pluginManagement>
|
||
|
</build>
|
||
|
|
||
|
|
||
|
</project>
|