<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2024 OceanBase.

Licensed 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>io.github.zentol.flink</groupId>
    <artifactId>flink-connector-parent</artifactId>
    <version>1.0</version>
  </parent>
  <groupId>com.oceanbase</groupId>
  <artifactId>flink-connector-oceanbase-parent</artifactId>
  <version>1.2</version>
  <packaging>pom</packaging>
  <inceptionYear>2023</inceptionYear>
  <organization>
    <name>OceanBase</name>
    <url>https://open.oceanbase.com</url>
  </organization>
  <licenses>
    <license>
      <name>Apache-2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>oceanbase</id>
      <name>OceanBase Developers</name>
      <email>open_contact@oceanbase.com</email>
      <roles>
        <role>Developer</role>
      </roles>
      <timezone>+8</timezone>
    </developer>
  </developers>
  <modules>
    <module>flink-connector-oceanbase-base</module>
    <module>flink-connector-obkv-hbase</module>
    <module>flink-connector-oceanbase</module>
    <module>flink-sql-connector-obkv-hbase</module>
    <module>flink-sql-connector-oceanbase</module>
  </modules>
  <scm>
    <connection>scm:git:https://github.com/oceanbase/flink-connector-oceanbase.git</connection>
    <developerConnection>scm:git:https://github.com/oceanbase/flink-connector-oceanbase.git</developerConnection>
    <url>https://github.com/oceanbase/flink-connector-oceanbase</url>
  </scm>
  <distributionManagement>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Nexus Release Repository</name>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <revision>1.2</revision>
    <scala.binary.version>2.12</scala.binary.version>
    <flink.version>1.18.0</flink.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>8</maven.compiler.source>
    <maven.compiler.target>8</maven.compiler.target>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers-bom</artifactId>
        <version>1.15.3</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>com.alibaba</groupId>
        <artifactId>druid</artifactId>
        <version>1.2.21</version>
      </dependency>
      <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>8.0.28</version>
        <exclusions>
          <exclusion>
            <groupId>com.google.protobuf</groupId>
            <artifactId>protobuf-java</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>com.oceanbase</groupId>
        <artifactId>ob-partition-calculator</artifactId>
        <version>1.8.0-RELEASE</version>
        <exclusions>
          <exclusion>
            <groupId>commons-collections</groupId>
            <artifactId>commons-collections</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>com.oceanbase</groupId>
        <artifactId>obkv-table-client</artifactId>
        <version>1.2.8</version>
        <exclusions>
          <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>32.0.0-jre</version>
        <exclusions>
          <exclusion>
            <groupId>com.google.guava</groupId>
            <artifactId>listenablefuture</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-table-api-java-bridge</artifactId>
      <version>${flink.version}</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>com.lmax</groupId>
      <artifactId>disruptor</artifactId>
      <version>3.4.2</version>
      <optional>true</optional>
    </dependency>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-test-utils</artifactId>
      <version>${flink.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-table-planner_${scala.binary.version}</artifactId>
      <version>${flink.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.apache.flink</groupId>
      <artifactId>flink-table-planner_${scala.binary.version}</artifactId>
      <version>${flink.version}</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>jdbc</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <quiet>true</quiet>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-jar-plugin</artifactId>
        <executions>
          <execution>
            <id>test-jar</id>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <executions>
          <execution>
            <phase>verify</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <inherited>false</inherited>
        <configuration>
          <consoleOutput>true</consoleOutput>
          <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>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <configuration>
          <java>
            <googleJavaFormat>
              <version>1.7</version>
              <style>AOSP</style>
            </googleJavaFormat>
            <importOrder>
              <order>com.oceanbase,org.apache.flink,org.apache.flink.shaded,,javax,java,scala,\#</order>
            </importOrder>
            <removeUnusedImports />
          </java>
          <pom>
            <sortPom>
              <encoding>UTF-8</encoding>
              <nrOfIndentSpace>4</nrOfIndentSpace>
              <keepBlankLines>true</keepBlankLines>
              <indentBlankLines>false</indentBlankLines>
              <indentSchemaLocation>false</indentSchemaLocation>
              <spaceBeforeCloseEmptyElement>true</spaceBeforeCloseEmptyElement>
              <sortModules>false</sortModules>
              <sortExecutions>false</sortExecutions>
              <predefinedSortOrder>custom_1</predefinedSortOrder>
              <expandEmptyElements>false</expandEmptyElements>
              <sortProperties>false</sortProperties>
            </sortPom>
            <replace>
              <name>Leading blank line</name>
              <search>project</search>
              <replacement>project</replacement>
            </replace>
          </pom>
          <markdown>
            <includes>
              <include>*.md</include>
              <include>docs/**/*.md</include>
            </includes>
            <flexmark />
          </markdown>
          <upToDateChecking>
            <enabled>true</enabled>
          </upToDateChecking>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-shade-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
        <version>1.5.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>
    </plugins>
  </build>
</project>
