<?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>
  <groupId>com.oceanbase</groupId>
  <artifactId>spark-connector-oceanbase-parent</artifactId>
  <version>1.3</version>
  <packaging>pom</packaging>
  <name>Spark Connector OceanBase</name>
  <description>Spark Connectors for OceanBase</description>
  <url>https://www.oceanbase.com/</url>
  <inceptionYear>2024</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>spark-connector-obkv-hbase</module>
    <module>spark-connector-oceanbase</module>
    <module>spark-connector-oceanbase-common</module>
    <module>spark-connector-oceanbase-e2e-tests</module>
  </modules>
  <scm>
    <connection>scm:git:https://github.com/oceanbase/spark-connector-oceanbase.git</connection>
    <developerConnection>scm:git:https://github.com/oceanbase/spark-connector-oceanbase.git</developerConnection>
    <url>https://github.com/oceanbase/spark-connector-oceanbase</url>
  </scm>
  <distributionManagement>
    <repository>
      <id>central</id>
      <name>Central Repository</name>
      <url>https://central.sonatype.com</url>
    </repository>
    <snapshotRepository>
      <id>central</id>
      <name>Central Snapshots Repository</name>
      <url>https://central.sonatype.com/repository/maven-snapshots/</url>
    </snapshotRepository>
  </distributionManagement>
  <properties>
    <scala-maven-plugin.version>3.2.2</scala-maven-plugin.version>
    <junit5.version>5.8.1</junit5.version>
    <target.java.version>1.8</target.java.version>
    <slf4j.version>1.7.32</slf4j.version>
    <junit4.version>4.13.2</junit4.version>
    <scala.binary.version>2.12</scala.binary.version>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <log4j.version>2.17.1</log4j.version>
    <spotless.version>2.27.1</spotless.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <revision>1.3</revision>
    <assertj.version>3.23.1</assertj.version>
    <scala.version>2.12.15</scala.version>
    <testcontainers.version>1.20.1</testcontainers.version>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit5.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit4.version}</version>
      </dependency>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers-bom</artifactId>
        <version>${testcontainers.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </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>oceanbase-client</artifactId>
        <version>2.4.12</version>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${assertj.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>oceanbase</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <repositories>
    <repository>
      <snapshots>
        <enabled>true</enabled>
      </snapshots>
      <id>sonatype-snapshots</id>
      <name>Sonatype Snapshot Repository</name>
      <url>https://central.sonatype.com/repository/maven-snapshots/</url>
    </repository>
  </repositories>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>build-helper-maven-plugin</artifactId>
          <version>1.7</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.0</version>
          <configuration>
            <source>${target.java.version}</source>
            <target>${target.java.version}</target>
            <useIncrementalCompilation>false</useIncrementalCompilation>
            <compilerArgs>
              <arg>-Xpkginfo:always</arg>
            </compilerArgs>
          </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>com.oceanbase,javax,java,scala,\#</order>
              </importOrder>
              <removeUnusedImports />
            </java>
            <scala>
              <scalafmt />
            </scala>
            <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-javadoc-plugin</artifactId>
          <version>2.9.1</version>
          <configuration>
            <quiet>true</quiet>
            <detectOfflineLinks>false</detectOfflineLinks>
            <additionalJOptions combine.children="append">
              <additionalJOption>-Xdoclint:none</additionalJOption>
            </additionalJOptions>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-enforcer-plugin</artifactId>
          <version>3.0.0-M1</version>
        </plugin>
        <plugin>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.4.1</version>
          <configuration>
            <shadeTestJar>false</shadeTestJar>
            <shadedArtifactAttached>false</shadedArtifactAttached>
            <createDependencyReducedPom>false</createDependencyReducedPom>
          </configuration>
        </plugin>
        <plugin>
          <groupId>org.scalastyle</groupId>
          <artifactId>scalastyle-maven-plugin</artifactId>
          <version>1.0.0</version>
          <executions>
            <execution>
              <goals>
                <goal>check</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <verbose>false</verbose>
            <failOnViolation>true</failOnViolation>
            <includeTestSourceDirectory>true</includeTestSourceDirectory>
            <failOnWarning>false</failOnWarning>
            <sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
            <testSourceDirectory>${basedir}/src/test/scala</testSourceDirectory>
            <outputFile>${project.basedir}/target/scalastyle-output.xml</outputFile>
            <inputEncoding>UTF-8</inputEncoding>
            <outputEncoding>UTF-8</outputEncoding>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.0.0-M5</version>
          <executions>
            <execution>
              <id>default-test</id>
              <phase>test</phase>
              <goals>
                <goal>test</goal>
              </goals>
              <configuration>
                <includes>
                  <include>**/*.*</include>
                  <include>**/*Test.*</include>
                </includes>
              </configuration>
            </execution>
          </executions>
          <configuration>
            <systemPropertyVariables>
              <junit.jupiter.extensions.autodetection.enabled>true</junit.jupiter.extensions.autodetection.enabled>
            </systemPropertyVariables>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <includePom>true</includePom>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>2.9.1</version>
        <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>
        <version>2.4</version>
        <executions>
          <execution>
            <id>test-jar</id>
            <goals>
              <goal>test-jar</goal>
            </goals>
          </execution>
          <execution>
            <id>empty-javadoc-jar</id>
            <phase>package</phase>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <classifier>javadoc</classifier>
              <classesDirectory>${basedir}/src/main/java</classesDirectory>
            </configuration>
          </execution>
        </executions>
        <configuration>
          <archive>
            <manifest>
              <addDefaultImplementationEntries>true</addDefaultImplementationEntries>
              <addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
            </manifest>
          </archive>
        </configuration>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>0.15</version>
        <executions>
          <execution>
            <phase>compile</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>**/*.prefs</exclude>
            <exclude>**/*.log</exclude>
            <exclude>**/*.md</exclude>
            <exclude>.github/**</exclude>
            <exclude>**/*.iml</exclude>
            <exclude>**/.idea/**</exclude>
            <exclude>**/target/**</exclude>
            <exclude>**/scalastyle-output.xml</exclude>
            <exclude>**/*.svg</exclude>
            <exclude>**/LICENSE*</exclude>
            <exclude>release/**</exclude>
            <exclude>**/dependency-reduced-pom.xml</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-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>
      <plugin>
        <artifactId>maven-gpg-plugin</artifactId>
        <version>3.0.1</version>
        <executions>
          <execution>
            <id>sign-artifacts</id>
            <phase>verify</phase>
            <goals>
              <goal>sign</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.sonatype.central</groupId>
        <artifactId>central-publishing-maven-plugin</artifactId>
        <version>0.9.0</version>
        <extensions>true</extensions>
        <configuration>
          <publishingServerId>central</publishingServerId>
          <autoPublish>true</autoPublish>
          <waitUntil>published</waitUntil>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>
