<?xml version="1.0" encoding="UTF-8"?>
<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.baidu.hugegraph</groupId>
    <artifactId>hugegraph-computer</artifactId>
    <version>0.1.0</version>
    <packaging>pom</packaging>
    <prerequisites>
        <maven>3.3.9</maven>
    </prerequisites>
    <name>hugegraph-computer</name>
    <url>https://github.com/hugegraph/hugegraph-computer</url>
    <description>
        hugegraph-computer is a fast-speed, highly-scalable, fault-tolerance graph processing system developed by baidu.
    </description>

    <inceptionYear>2020</inceptionYear>
    <licenses>
        <license>
            <name>The Apache Software License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <parent>
        <groupId>org.sonatype.oss</groupId>
        <artifactId>oss-parent</artifactId>
        <version>7</version>
    </parent>

    <scm>
        <url>https://github.com/hugegraph/hugegraph-computer</url>
        <connection>https://github.com/hugegraph/hugegraph-computer</connection>
        <developerConnection>https://github.com/hugegraph/hugegraph-computer</developerConnection>
    </scm>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <top.level.dir>${project.basedir}/..</top.level.dir>
        <release.name>hugegraph-computer</release.name>
        <final.name>${release.name}-${project.version}</final.name>
        <compiler.source>1.8</compiler.source>
        <compiler.target>1.8</compiler.target>
        <shell-executable>bash</shell-executable>
        <etcd.version>0.5.4</etcd.version>
    </properties>

    <modules>
        <module>computer-api</module>
        <module>computer-core</module>
        <module>computer-algorithm</module>
        <module>computer-driver</module>
        <module>computer-yarn</module>
        <module>computer-k8s</module>
        <module>computer-k8s-operator</module>
        <module>computer-dist</module>
        <module>computer-test</module>
    </modules>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.baidu.hugegraph</groupId>
                <artifactId>hugegraph-common</artifactId>
                <version>1.8.9</version>
            </dependency>
            <dependency>
                <groupId>com.baidu.hugegraph</groupId>
                <artifactId>hugegraph-rpc</artifactId>
                <version>1.0.1</version>
                <exclusions>
                    <!-- conflict with etcd -->
                    <exclusion>
                        <groupId>io.grpc</groupId>
                        <artifactId>grpc-netty-shaded</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.baidu.hugegraph</groupId>
                <artifactId>hugegraph-client</artifactId>
                <version>1.9.6</version>
            </dependency>
            <dependency>
                <groupId>io.netty</groupId>
                <artifactId>netty-all</artifactId>
                <version>4.1.42.Final</version>
            </dependency>
            <dependency>
                <groupId>io.etcd</groupId>
                <artifactId>jetcd-core</artifactId>
                <version>${etcd.version}</version>
                <exclusions>
                    <!-- conflict with netty -->
                    <exclusion>
                        <groupId>io.netty</groupId>
                        <artifactId>netty-codec-http2</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>io.netty</groupId>
                        <artifactId>netty-handler-proxy</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <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>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <version>3.1.0</version>
                <configuration>
                    <configLocation>checkstyle.xml</configLocation>
                    <encoding>UTF-8</encoding>
                    <consoleOutput>true</consoleOutput>
                    <failsOnError>true</failsOnError>
                    <linkXRef>false</linkXRef>
                    <includeTestSourceDirectory>false</includeTestSourceDirectory>
                </configuration>
                <executions>
                    <execution>
                        <id>validate</id>
                        <phase>validate</phase>
                        <goals>
                            <goal>check</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.20</version>
            </plugin>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <version>3.0.0</version>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>${final.name}</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>unit-test</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.20</version>
                        <executions>
                            <execution>
                                <id>unit-test</id>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <phase>test</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
        <profile>
            <id>integrate-test</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-surefire-plugin</artifactId>
                        <version>2.20</version>
                        <executions>
                            <execution>
                                <id>integrate-test</id>
                                <goals>
                                    <goal>test</goal>
                                </goals>
                                <phase>test</phase>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>2.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>2.9.1</version>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <additionalJOptions>
                                <additionalJOption>-Xdoclint:none</additionalJOption>
                            </additionalJOptions>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.5</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
<!--                    <plugin>-->
<!--                        <groupId>org.sonatype.plugins</groupId>-->
<!--                        <artifactId>nexus-staging-maven-plugin</artifactId>-->
<!--                        <version>1.6.3</version>-->
<!--                        <extensions>true</extensions>-->
<!--                        <configuration>-->
<!--                            <serverId>ossrh</serverId>-->
<!--                            <nexusUrl>https://oss.sonatype.org/</nexusUrl>-->
<!--                            <autoReleaseAfterClose>false</autoReleaseAfterClose>-->
<!--                        </configuration>-->
<!--                    </plugin>-->
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
