<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.apache</groupId>
    <artifactId>apache</artifactId>
    <version>20</version>
  </parent>
  <groupId>com.tencent.bk.base.datahub</groupId>
  <artifactId>flink-cdc-connectors</artifactId>
  <version>2.2.1-bkbase.2</version>
  <packaging>pom</packaging>
  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <modules>
    <module>flink-cdc-base</module>
    <module>flink-connector-debezium</module>
    <module>flink-connector-test-util</module>
    <module>flink-connector-mysql-cdc</module>
    <module>flink-connector-postgres-cdc</module>
    <module>flink-connector-oracle-cdc</module>
    <module>flink-connector-mongodb-cdc</module>
    <module>flink-connector-oceanbase-cdc</module>
    <module>flink-connector-sqlserver-cdc</module>
    <module>flink-connector-tidb-cdc</module>
    <module>flink-sql-connector-mysql-cdc</module>
    <module>flink-sql-connector-postgres-cdc</module>
    <module>flink-sql-connector-mongodb-cdc</module>
    <module>flink-sql-connector-oracle-cdc</module>
    <module>flink-sql-connector-oceanbase-cdc</module>
    <module>flink-sql-connector-sqlserver-cdc</module>
    <module>flink-sql-connector-tidb-cdc</module>
    <module>flink-cdc-e2e-tests</module>
  </modules>
  <distributionManagement>
    <repository>
      <id>oss</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>oss</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <bk.debezium.version>1.5.4-bkbase.1</bk.debezium.version>
    <spotless.version>2.4.2</spotless.version>
    <flink.reuseForks>true</flink.reuseForks>
    <tikv.version>3.2.0</tikv.version>
    <hamcrest.version>1.3</hamcrest.version>
    <scala.binary.version>2.11</scala.binary.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <flink.forkCount>1</flink.forkCount>
    <revision>2.2.1-bkbase.2</revision>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <geometry.version>2.2.0</geometry.version>
    <java.version>1.8</java.version>
    <slf4j.version>1.7.15</slf4j.version>
    <debezium.version>1.5.4.Final</debezium.version>
    <oblogclient.version>1.0.3</oblogclient.version>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <version.awaitility>4.0.1</version.awaitility>
    <testcontainers.version>1.15.3</testcontainers.version>
    <log4j.version>2.17.1</log4j.version>
    <flink.version>1.13.5</flink.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-table-common</artifactId>
      <version>${flink.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-table-api-java-bridge_${scala.binary.version}</artifactId>
      <version>${flink.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-core</artifactId>
      <version>${flink.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-streaming-java_${scala.binary.version}</artifactId>
      <version>${flink.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-shaded-guava</artifactId>
      <version>18.0-13.0</version>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest-all</artifactId>
      <version>${hamcrest.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-slf4j-impl</artifactId>
      <version>${log4j.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-api</artifactId>
      <version>${log4j.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-core</artifactId>
      <version>${log4j.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.logging.log4j</groupId>
      <artifactId>log4j-1.2-api</artifactId>
      <version>${log4j.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>${version.awaitility}</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-site-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-descriptor</id>
            <phase>none</phase>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>0.12</version>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <inherited>false</inherited>
        <configuration>
          <excludeSubProjects>false</excludeSubProjects>
          <numUnapprovedLicenses>0</numUnapprovedLicenses>
          <licenses>
            <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
              <licenseFamilyCategory>AL2</licenseFamilyCategory>
              <licenseFamilyName>Apache License 2.0</licenseFamilyName>
              <notes />
              <patterns>
                <pattern>Licensed to the Apache Software Foundation (ASF) under
                                    one</pattern>
              </patterns>
            </license>
          </licenses>
          <licenseFamilies>
            <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
              <familyName>Apache License 2.0</familyName>
            </licenseFamily>
          </licenseFamilies>
          <excludes>
            <exclude>**/.*/**</exclude>
            <exclude>**/target/**</exclude>
            <exclude>**/*.iml</exclude>
            <exclude>**/*.md</exclude>
            <exclude>docs/Makefile</exclude>
            <exclude>docs/Dockerfile</exclude>
            <exclude>docs/make.bat</exclude>
            <exclude>docs/_templates/version.html</exclude>
            <exclude>docs/_static/button.js</exclude>
            <exclude>docs/site/**</exclude>
            <exclude>**/*.txt</exclude>
            <exclude>flink-connector-mysql-cdc/src/test/resources/file/*.json</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
        <version>1.1.0</version>
        <executions>
          <execution>
            <id>flatten</id>
            <phase>process-resources</phase>
            <goals>
              <goal>flatten</goal>
            </goals>
          </execution>
          <execution>
            <id>flatten.clean</id>
            <phase>clean</phase>
            <goals>
              <goal>clean</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <updatePomFile>true</updatePomFile>
          <flattenMode>resolveCiFriendliesOnly</flattenMode>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless.version}</version>
        <executions>
          <execution>
            <id>spotless-check</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <java>
            <googleJavaFormat>
              <version>1.7</version>
              <style>AOSP</style>
            </googleJavaFormat>
            <importOrder>
              <order>org.apache.flink,org.apache.flink.shaded,,javax,java,scala,\#</order>
            </importOrder>
            <removeUnusedImports />
          </java>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>2.17</version>
        <executions>
          <execution>
            <id>validate</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <dependencies>
          <dependency>
            <groupId>com.puppycrawl.tools</groupId>
            <artifactId>checkstyle</artifactId>
            <version>8.14</version>
          </dependency>
        </dependencies>
        <configuration>
          <suppressionsLocation>/tools/maven/suppressions.xml</suppressionsLocation>
          <includeTestSourceDirectory>true</includeTestSourceDirectory>
          <configLocation>/tools/maven/checkstyle.xml</configLocation>
          <logViolationsToConsole>true</logViolationsToConsole>
          <failOnViolation>true</failOnViolation>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.22.0</version>
        <executions>
          <execution>
            <id>default-test</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <includes>
                <include>**/*Test.java</include>
                <include>**/*Test.scala</include>
              </includes>
            </configuration>
          </execution>
          <execution>
            <id>integration-tests</id>
            <phase>integration-test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <includes>
                <include>**/*ITCase.java</include>
                <include>**/*ITCase.scala</include>
              </includes>
              <reuseForks>false</reuseForks>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <forkCount>${flink.forkCount}</forkCount>
          <reuseForks>${flink.reuseForks}</reuseForks>
          <systemPropertyVariables>
            <forkNumber>0${surefire.forkNumber}</forkNumber>
          </systemPropertyVariables>
          <argLine>-Xms256m -Xmx2048m -Dmvn.forkNumber=${surefire.forkNumber}
                        -XX:+UseG1GC -Doracle.jdbc.timezoneAsRegion=false</argLine>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
        <executions>
          <execution>
            <id>shade-flink</id>
            <phase>package</phase>
            <goals>
              <goal>shade</goal>
            </goals>
            <configuration>
              <shadeTestJar>false</shadeTestJar>
              <shadedArtifactAttached>false</shadedArtifactAttached>
              <createDependencyReducedPom>true</createDependencyReducedPom>
              <dependencyReducedPomLocation>${project.basedir}/target/dependency-reduced-pom.xml</dependencyReducedPomLocation>
              <filters combine.children="append">
                <filter>
                  <artifact>*:*</artifact>
                  <excludes>
                    <exclude>module-info.class</exclude>
                    <exclude>META-INF/*.SF</exclude>
                    <exclude>META-INF/*.DSA</exclude>
                    <exclude>META-INF/*.RSA</exclude>
                  </excludes>
                </filter>
              </filters>
              <artifactSet>
                <includes>
                  <include></include>
                </includes>
              </artifactSet>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.0.0-M1</version>
        <executions>
          <execution>
            <id>dependency-convergence</id>
            <phase>none</phase>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <dependencyConvergence />
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>test-jar</id>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <doclint>none</doclint>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <profiles>
    <profile>
      <id>release</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <artifactId>maven-release-plugin</artifactId>
              <version>2.1</version>
              <configuration>
                <mavenExecutorId>forked-path</mavenExecutorId>
                <useReleaseProfile>false</useReleaseProfile>
                <arguments> -Psonatype-oss-release</arguments>
                <goals>deploy</goals>
                <waitBeforeTagging>10</waitBeforeTagging>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <keyname>BF160A1E</keyname>
                  <passphrase>bk#van@2021</passphrase>
                  <secretKeyring>C:/code/github/vanliu/gpg/secring.gpg</secretKeyring>
                  <gpgArguments>
                    <arg>--digest-algo=SHA512</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <gpgArguments>
                <arg>--digest-algo=SHA512</arg>
              </gpgArguments>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-enforcer-plugin</artifactId>
            <executions>
              <execution>
                <id>enforce-java</id>
                <goals>
                  <goal>enforce</goal>
                </goals>
                <configuration>
                  <rules>
                    <requireJavaVersion>
                      <version>[1.8,)</version>
                    </requireJavaVersion>
                  </rules>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2.1</version>
            <executions>
              <execution>
                <id>attach-sources</id>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>net.ju-n.maven.plugins</groupId>
            <artifactId>checksum-maven-plugin</artifactId>
            <version>1.4</version>
            <executions>
              <execution>
                <goals>
                  <goal>artifacts</goal>
                </goals>
                <configuration>
                  <algorithms>
                    <algorithm>SHA-256</algorithm>
                  </algorithms>
                  <failOnError>false</failOnError>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <algorithms>
                <algorithm>SHA-256</algorithm>
              </algorithms>
              <failOnError>false</failOnError>
            </configuration>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.9.1</version>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <quiet>true</quiet>
                  <detectOfflineLinks>false</detectOfflineLinks>
                  <additionalJOptions combine.children="append">
                    <additionalJOption>-Xdoclint:none</additionalJOption>
                  </additionalJOptions>
                  <doclint>none</doclint>
                </configuration>
              </execution>
            </executions>
            <configuration>
              <quiet>true</quiet>
              <detectOfflineLinks>false</detectOfflineLinks>
              <additionalJOptions combine.children="append">
                <additionalJOption>-Xdoclint:none</additionalJOption>
              </additionalJOptions>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
