<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2021 OceanBase and/or its affiliates. All rights reserved.
oblogclient is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
         http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
-->
<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>com.oceanbase</groupId>
  <artifactId>oblogclient</artifactId>
  <version>1.1.0</version>
  <packaging>pom</packaging>

  <name>${project.groupId}:${project.artifactId}</name>
  <description>OceanBase Log Client.</description>
  <url>https://github.com/oceanbase/oblogclient</url>

  <licenses>
    <license>
      <name>Mulan Permissive Software License，Version 2</name>
      <url>http://license.coscl.org.cn/MulanPSL2/</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Si Jiang</name>
      <email>cmbjiangsi5@163.com</email>
      <url>https://github.com/hitandrun-zz</url>
      <organization>OceanBase</organization>
      <timezone>8</timezone>
    </developer>
    <developer>
      <name>Fankux</name>
      <email>fankux@gmail.com</email>
      <url>https://github.com/fankux</url>
      <organization>OceanBase</organization>
      <timezone>8</timezone>
    </developer>
    <developer>
      <name>He Wang</name>
      <email>wanghechn@qq.com</email>
      <url>https://github.com/whhe</url>
      <organization>OceanBase</organization>
      <timezone>8</timezone>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/oceanbase/oblogclient.git</connection>
    <developerConnection>scm:git:https://github.com/oceanbase/oblogclient.git</developerConnection>
    <url>https://github.com/oceanbase/oblogclient</url>
    <tag>oblogclient-1.1.0</tag>
  </scm>

  <properties>
    <encoding>UTF-8</encoding>
    <project.build.sourceEncoding>${encoding}</project.build.sourceEncoding>
    <project.reporting.outputEncoding>${encoding}</project.reporting.outputEncoding>

    <java.version>1.8</java.version>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <maven.compiler.target>${java.version}</maven.compiler.target>

    <commons-lang.version>3.12.0</commons-lang.version>
    <commons-codec.version>1.15</commons-codec.version>
    <netty.version>4.1.77.Final</netty.version>
    <protobuf.version>3.19.6</protobuf.version>
    <lz4.version>1.8.0</lz4.version>
    <slf4j.version>1.7.32</slf4j.version>
    <logback.version>1.2.10</logback.version>
    <junit.version>4.13.1</junit.version>
  </properties>

  <modules>
    <module>oblogclient-common</module>
    <module>oblogclient-logproxy</module>
  </modules>

  <dependencyManagement>
    <dependencies>
      <!-- common -->
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>${commons-lang.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-codec</groupId>
        <artifactId>commons-codec</artifactId>
        <version>${commons-codec.version}</version>
      </dependency>

      <!-- net -->
      <dependency>
        <groupId>io.netty</groupId>
        <artifactId>netty-all</artifactId>
        <version>${netty.version}</version>
      </dependency>

      <!-- data protocol -->
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>${protobuf.version}</version>
      </dependency>
      <dependency>
        <groupId>org.lz4</groupId>
        <artifactId>lz4-java</artifactId>
        <version>${lz4.version}</version>
      </dependency>

      <!-- SLF4J -->
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>

      <!-- test -->
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>${logback.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <distributionManagement>
    <snapshotRepository>
      <id>sonatype-nexus-snapshots</id>
      <name>Sonatype Nexus Snapshots</name>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots/</url>
    </snapshotRepository>
    <repository>
      <id>sonatype-nexus-staging</id>
      <name>Nexus Release Repository</name>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
  </distributionManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.1</version>
        <configuration>
          <source>${maven.compiler.source}</source>
          <target>${maven.compiler.target}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.2.1</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>3.3.1</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
            <configuration>
              <failOnWarnings>true</failOnWarnings>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.rat</groupId>
        <artifactId>apache-rat-plugin</artifactId>
        <version>0.12</version>
        <inherited>false</inherited>
        <executions>
          <execution>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <excludeSubProjects>false</excludeSubProjects>
          <numUnapprovedLicenses>0</numUnapprovedLicenses>
          <licenses>
            <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
              <licenseFamilyCategory>MulanPSL2</licenseFamilyCategory>
              <licenseFamilyName>Mulan Public License，Version 2</licenseFamilyName>
              <notes />
              <patterns>
                <pattern>Mulan PSL v2</pattern>
              </patterns>
            </license>
          </licenses>
          <licenseFamilies>
            <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
              <familyName>Mulan Public License，Version 2</familyName>
            </licenseFamily>
          </licenseFamilies>
          <excludes>
            <!-- Additional files like .gitignore etc.-->
            <exclude>**/.*/**</exclude>
            <!-- Generated content -->
            <exclude>**/target/**</exclude>
            <!-- Build files -->
            <exclude>**/*.iml</exclude>
            <!-- Docs -->
            <exclude>**/*.md</exclude>
            <!-- Tests -->
            <exclude>**/*.key</exclude>
            <exclude>**/*.crt</exclude>
          </excludes>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>2.4.2</version>
        <configuration>
          <java>
            <excludes>
              <!-- Generated files. -->
              <exclude>**/LogProxyProto.java</exclude>
              <exclude>**/V1Proto.java</exclude>
            </excludes>
            <googleJavaFormat>
              <version>1.7</version>
              <style>AOSP</style>
            </googleJavaFormat>
            <importOrder />
            <removeUnusedImports />
          </java>
        </configuration>
        <executions>
          <execution>
            <id>spotless-check</id>
            <phase>validate</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
</project>
