<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to LinDB under one or more contributor
    license agreements. See the NOTICE file distributed with
    this work for additional information regarding copyright
    ownership. LinDB 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 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">
   <artifactId>lindb-client</artifactId>
   <groupId>io.lindb</groupId>
   <version>0.0.4</version>
   <modelVersion>4.0.0</modelVersion>
   <packaging>jar</packaging>
   <name>LinDB Java Client SDK</name>
   <description>The reference JVM client for the LinDB.</description>
   <url>https://github.com/lindb/client_java</url>
   <organization>
      <name>LinDB</name>
      <url>https://lindb.io</url>
   </organization>
   <developers>
      <developer>
         <name>stone1100</name>
         <email>stonejh1100@gmail.com</email>
         <organization>LinDB</organization>
         <organizationUrl>https://www.lindb.io</organizationUrl>
      </developer>
      <developer>
         <name>CodingCrush</name>
         <email>codingcrush@163.com</email>
         <organization>LinDB</organization>
         <organizationUrl>https://www.lindb.io</organizationUrl>
      </developer>
   </developers>
   <licenses>
      <license>
         <name>Apache License, Version 2.0</name>
         <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
         <distribution>repo</distribution>
      </license>
   </licenses>
   <scm>
      <url>https://github.com/lindb/client_java</url>
      <developerConnection>scm:git:git@github.com:lindb/client_java.git</developerConnection>
      <tag>HEAD</tag>
   </scm>
   <properties>
      <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      <maven.compiler.source>1.8</maven.compiler.source>
      <maven.compiler.target>1.8</maven.compiler.target>
      <proto.sources>${basedir}/proto</proto.sources>
      <generated.sources>${basedir}/src/generated/java</generated.sources>
      <maven.exec.skip>false</maven.exec.skip>
   </properties>
   <dependencies>
      <dependency>
         <groupId>javax.annotation</groupId>
         <artifactId>javax.annotation-api</artifactId>
         <version>1.3.2</version>
      </dependency>
      <dependency>
         <groupId>com.google.guava</groupId>
         <artifactId>guava</artifactId>
         <version>31.1-jre</version>
      </dependency>
      <dependency>
         <groupId>com.google.flatbuffers</groupId>
         <artifactId>flatbuffers-java</artifactId>
         <version>23.3.3</version>
      </dependency>
      <dependency>
         <groupId>com.squareup.okhttp3</groupId>
         <artifactId>okhttp</artifactId>
         <version>4.10.0</version>
      </dependency>
      <dependency>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-api</artifactId>
         <version>2.0.3</version>
      </dependency>
      <dependency>
         <groupId>com.fasterxml.jackson.core</groupId>
         <artifactId>jackson-core</artifactId>
         <version>2.14.2</version>
      </dependency>
      <dependency>
         <groupId>com.fasterxml.jackson.core</groupId>
         <artifactId>jackson-databind</artifactId>
         <version>2.14.2</version>
      </dependency>
      <dependency>
         <groupId>com.fasterxml.jackson.core</groupId>
         <artifactId>jackson-annotations</artifactId>
         <version>2.14.2</version>
      </dependency>
      <dependency>
         <groupId>org.projectlombok</groupId>
         <artifactId>lombok</artifactId>
         <version>1.18.26</version>
         <scope>provided</scope>
      </dependency>
      <!-- test dependencies -->
      <dependency>
         <groupId>ch.qos.logback</groupId>
         <artifactId>logback-classic</artifactId>
         <version>1.4.4</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>junit</groupId>
         <artifactId>junit</artifactId>
         <version>4.13.2</version>
         <scope>test</scope>
      </dependency>
      <dependency>
         <groupId>com.squareup.okhttp3</groupId>
         <artifactId>mockwebserver</artifactId>
         <version>4.10.0</version>
         <scope>test</scope>
      </dependency>
   </dependencies>
   <build>
      <plugins>
         <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.4.1</version>
            <executions>
               <execution>
                  <id>attach-javadocs</id>
                  <goals>
                     <goal>jar</goal>
                  </goals>
               </execution>
            </executions>
            <configuration>
               <excludePackageNames>io.lindb.client.flat.metrics.*</excludePackageNames>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.10.1</version>
            <configuration>
               <source>1.8</source>
               <target>1.8</target>
               <encoding>utf-8</encoding>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>3.1.0</version>
            <executions>
               <execution>
                  <goals>
                     <goal>exec</goal>
                  </goals>
                  <phase>generate-sources</phase>
               </execution>
            </executions>
            <configuration>
               <skip>${maven.exec.skip}</skip>
               <executable>flatc</executable>
               <workingDirectory>${proto.sources}</workingDirectory>
               <arguments>
                  <argument>--java</argument>
                  <argument>--gen-generated</argument>
                  <argument>-o</argument>
                  <argument>${generated.sources}</argument>
                  <argument>metrics.fbs</argument>
               </arguments>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <version>3.3.0</version>
            <executions>
               <execution>
                  <id>add-source</id>
                  <phase>generate-sources</phase>
                  <goals>
                     <goal>add-source</goal>
                  </goals>
                  <configuration>
                     <sources>
                        <source>${generated.sources}</source>
                     </sources>
                  </configuration>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>org.jacoco</groupId>
            <artifactId>jacoco-maven-plugin</artifactId>
            <version>0.8.8</version>
            <configuration>
               <excludes>
                  <exclude>io/lindb/client/flat/metrics/v1/*</exclude>
                  <exclude>io/lindb/client/model/*</exclude>
               </excludes>
            </configuration>
            <executions>
               <execution>
                  <goals>
                     <goal>prepare-agent</goal>
                  </goals>
               </execution>
               <execution>
                  <id>generate-code-coverage-report</id>
                  <phase>test</phase>
                  <goals>
                     <goal>report</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
         <plugin>
            <groupId>com.mycila</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <version>4.1</version>
            <configuration>
               <mapping>
                  <java>JAVADOC_STYLE</java>
               </mapping>
               <licenseSets>
                  <licenseSet>
                     <header>license_header.txt</header>
                     <excludes>
                        <exclude>proto/**</exclude>
                        <exclude>**/README</exclude>
                        <exclude>Makefile</exclude>
                        <exclude>src/test/resources/**</exclude>
                        <exclude>src/main/resources/**</exclude>
                     </excludes>
                  </licenseSet>
               </licenseSets>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <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>
            <configuration>
               <!-- Prevent gpg from using pinentry programs -->
               <gpgArguments>
                  <arg>--pinentry-mode</arg>
                  <arg>loopback</arg>
               </gpgArguments>
            </configuration>
         </plugin>
         <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.13</version>
            <extensions>true</extensions>
            <configuration>
               <serverId>ossrh</serverId>
               <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
               <description>${project.version}</description>
               <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
            <executions>
               <execution>
                  <id>deploy-to-sonatype</id>
                  <phase>deploy</phase>
                  <goals>
                     <goal>deploy</goal>
                     <goal>release</goal>
                  </goals>
               </execution>
            </executions>
         </plugin>
      </plugins>
   </build>
   <profiles>
      <!-- GPG Signature on release -->
      <profile>
         <id>release-sign-artifacts</id>
         <activation>
            <property>
               <name>performRelease</name>
               <value>true</value>
            </property>
         </activation>
         <build>
            <plugins>
               <plugin>
                  <groupId>org.apache.maven.plugins</groupId>
                  <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>
            </plugins>
         </build>
      </profile>
   </profiles>
   <distributionManagement>
      <snapshotRepository>
         <id>ossrh</id>
         <name>Central Repository OSSRH</name>
         <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
      </snapshotRepository>
      <repository>
         <id>ossrh</id>
         <name>Central Repository OSSRH</name>
         <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
      </repository>
   </distributionManagement>
</project>
