<?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.hugegraph</groupId>
    <artifactId>hugegraph</artifactId>
    <version>1.3.0</version>
  </parent>
  <groupId>org.apache.hugegraph</groupId>
  <artifactId>hugegraph-server</artifactId>
  <version>1.3.0</version>
  <packaging>pom</packaging>
  <name>${project.artifactId}</name>
  <description>HugeGraph server is the graph engine layer of HugeGraph, including REST-API, OLTP engine and backends interface.</description>
  <url>https://github.com/apache/hugegraph/tree/master/hugegraph-server</url>
  <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>hugegraph-core</module>
    <module>hugegraph-api</module>
    <module>hugegraph-example</module>
    <module>hugegraph-dist</module>
    <module>hugegraph-test</module>
    <module>hugegraph-cassandra</module>
    <module>hugegraph-scylladb</module>
    <module>hugegraph-rocksdb</module>
    <module>hugegraph-mysql</module>
    <module>hugegraph-palo</module>
    <module>hugegraph-hbase</module>
    <module>hugegraph-postgresql</module>
  </modules>
  <properties>
    <grpc.version>1.47.0</grpc.version>
    <hugegraph-commons.version>1.3.0</hugegraph-commons.version>
    <final.destfile>${top.level.dir}/${final.name}.tar.gz</final.destfile>
    <tinkerpop.version>3.5.1</tinkerpop.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <javassist.version>3.21.0-GA</javassist.version>
    <junit.version>4.13.1</junit.version>
    <httpclient.version>4.5.13</httpclient.version>
    <commons.io.version>2.7</commons.io.version>
    <arthas.version>3.7.1</arthas.version>
    <release.name>hugegraph</release.name>
    <swagger.version>2.2.18</swagger.version>
    <slf4j.version>1.7.5</slf4j.version>
    <compiler.source>1.8</compiler.source>
    <top.level.dir>${project.basedir}/..</top.level.dir>
    <jmh.version>1.36</jmh.version>
    <checkstyle.version>8.45</checkstyle.version>
    <shell-executable>bash</shell-executable>
    <guava.version>25.1-jre</guava.version>
    <log4j2.version>2.17.1</log4j2.version>
    <protobuf.version>3.21.7</protobuf.version>
    <metrics.version>4.2.4</metrics.version>
    <jersey.version>3.0.3</jersey.version>
    <compiler.target>1.8</compiler.target>
    <log4j.version>1.2.17</log4j.version>
    <checkstyle.plugin.version>3.1.2</checkstyle.plugin.version>
    <final.name>apache-${release.name}-incubating-${project.version}</final.name>
  </properties>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.apache.hugegraph</groupId>
        <artifactId>hugegraph-rpc</artifactId>
        <version>${hugegraph-commons.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.hugegraph</groupId>
        <artifactId>hugegraph-common</artifactId>
        <version>${hugegraph-commons.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-api</artifactId>
        <version>${log4j2.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-core</artifactId>
        <version>${log4j2.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.logging.log4j</groupId>
        <artifactId>log4j-slf4j-impl</artifactId>
        <version>${log4j2.version}</version>
      </dependency>
      <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>${junit.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.tinkerpop</groupId>
        <artifactId>gremlin-core</artifactId>
        <version>${tinkerpop.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.tinkerpop</groupId>
        <artifactId>gremlin-server</artifactId>
        <version>${tinkerpop.version}</version>
        <exclusions>
          <exclusion>
            <groupId>com.github.jeremyh</groupId>
            <artifactId>jBCrypt</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.tinkerpop</groupId>
        <artifactId>gremlin-console</artifactId>
        <version>${tinkerpop.version}</version>
        <exclusions>
          <exclusion>
            <groupId>com.github.jeremyh</groupId>
            <artifactId>jBCrypt</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.tinkerpop</groupId>
        <artifactId>gremlin-groovy</artifactId>
        <version>${tinkerpop.version}</version>
        <exclusions>
          <exclusion>
            <groupId>com.github.jeremyh</groupId>
            <artifactId>jBCrypt</artifactId>
          </exclusion>
        </exclusions>
      </dependency>
      <dependency>
        <groupId>org.apache.tinkerpop</groupId>
        <artifactId>tinkergraph-gremlin</artifactId>
        <version>${tinkerpop.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.tinkerpop</groupId>
        <artifactId>gremlin-test</artifactId>
        <version>${tinkerpop.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.tinkerpop</groupId>
        <artifactId>gremlin-groovy-test</artifactId>
        <version>3.2.11</version>
      </dependency>
      <dependency>
        <groupId>org.apache.tinkerpop</groupId>
        <artifactId>gremlin-driver</artifactId>
        <version>${tinkerpop.version}</version>
      </dependency>
      <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>${commons.io.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.httpcomponents</groupId>
        <artifactId>httpclient</artifactId>
        <version>${httpclient.version}</version>
      </dependency>
      <dependency>
        <groupId>org.glassfish.jersey.core</groupId>
        <artifactId>jersey-server</artifactId>
        <version>${jersey.version}</version>
      </dependency>
      <dependency>
        <groupId>org.glassfish.jersey.containers</groupId>
        <artifactId>jersey-container-grizzly2-http</artifactId>
        <version>${jersey.version}</version>
      </dependency>
      <dependency>
        <groupId>org.glassfish.jersey.containers</groupId>
        <artifactId>jersey-container-grizzly2-servlet</artifactId>
        <version>${jersey.version}</version>
      </dependency>
      <dependency>
        <groupId>org.glassfish.jersey.media</groupId>
        <artifactId>jersey-media-json-jackson</artifactId>
        <version>${jersey.version}</version>
      </dependency>
      <dependency>
        <groupId>org.glassfish.jersey.test-framework.providers</groupId>
        <artifactId>jersey-test-framework-provider-grizzly2</artifactId>
        <version>${jersey.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-json</artifactId>
        <version>${metrics.version}</version>
      </dependency>
      <dependency>
        <groupId>io.dropwizard.metrics</groupId>
        <artifactId>metrics-jersey3</artifactId>
        <version>${metrics.version}</version>
      </dependency>
      <dependency>
        <groupId>org.javassist</groupId>
        <artifactId>javassist</artifactId>
        <version>${javassist.version}</version>
      </dependency>
      <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-netty</artifactId>
        <version>${grpc.version}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>io.grpc</groupId>
        <artifactId>grpc-stub</artifactId>
        <version>${grpc.version}</version>
        <scope>provided</scope>
      </dependency>
      <dependency>
        <groupId>com.google.protobuf</groupId>
        <artifactId>protobuf-java</artifactId>
        <version>${protobuf.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-text</artifactId>
        <version>1.10.0</version>
      </dependency>
      <dependency>
        <groupId>org.openjdk.jmh</groupId>
        <artifactId>jmh-core</artifactId>
        <version>${jmh.version}</version>
        <scope>test</scope>
      </dependency>
      <dependency>
        <groupId>org.openjdk.jmh</groupId>
        <artifactId>jmh-generator-annprocess</artifactId>
        <version>${jmh.version}</version>
        <scope>test</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.1</version>
          <configuration>
            <source>${compiler.source}</source>
            <target>${compiler.target}</target>
            <compilerArguments>
              <Xmaxerrs>500</Xmaxerrs>
            </compilerArguments>
            <compilerArgs>
              <arg>-Xlint:unchecked</arg>
            </compilerArgs>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <configuration>
            <filesets>
              <fileset>
                <directory>${project.basedir}/</directory>
                <includes>
                  <include>*.tar</include>
                  <include>*.tar.gz</include>
                  <include>.flattened-pom.xml</include>
                  <include>${final.name}/**</include>
                </includes>
                <followSymlinks>false</followSymlinks>
              </fileset>
              <fileset>
                <directory>${final.name}</directory>
              </fileset>
              <fileset>
                <directory>../${project.basedir}</directory>
                <includes>
                  <include>*.tar.gz</include>
                </includes>
              </fileset>
              <fileset>
                <directory>../${final.name}</directory>
              </fileset>
            </filesets>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>${checkstyle.plugin.version}</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>${checkstyle.version}</version>
          </dependency>
        </dependencies>
        <configuration>
          <configLocation>style/checkstyle.xml</configLocation>
          <encoding>UTF-8</encoding>
          <consoleOutput>true</consoleOutput>
          <failsOnError>true</failsOnError>
          <linkXRef>false</linkXRef>
          <includeTestSourceDirectory>false</includeTestSourceDirectory>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>flatten-maven-plugin</artifactId>
        <version>1.2.7</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>
  <profiles>
    <profile>
      <id>core-test</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>core-test</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>unit-test</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>unit-test</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>api-test</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>api-test</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>tinkerpop-structure-test</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>tinkerpop-structure-test</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>tinkerpop-process-test</id>
      <build>
        <plugins>
          <plugin>
            <artifactId>maven-surefire-plugin</artifactId>
            <executions>
              <execution>
                <id>tinkerpop-process-test</id>
                <phase>test</phase>
                <goals>
                  <goal>test</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
