<?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 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>io.milvus</groupId>
    <artifactId>milvus-sdk-java-parent</artifactId>
    <version>${revision}</version>
    <packaging>pom</packaging>

    <name>${project.artifactId}</name>
    <description>Java SDK for Milvus, a distributed high-performance vector database.</description>
    <url>https://github.com/milvus-io/milvus-sdk-java</url>

    <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>

    <developers>
        <developer>
            <name>Xiaofan Luan</name>
            <email>xiaofan.luan@zilliz.com</email>
            <organization>Milvus</organization>
            <organizationUrl>http://www.milvus.io</organizationUrl>
        </developer>
    </developers>
    <modules>
        <module>sdk-core</module>
        <module>sdk-bulkwriter</module>
    </modules>

    <scm>
        <connection>scm:git:https://github.com/milvus-io/milvus-sdk-java.git</connection>
        <developerConnection>scm:git:https://github.com/milvus-io/milvus-sdk-java.git</developerConnection>
        <url>https://github.com/milvus-io/milvus-sdk-java</url>
    </scm>

    <distributionManagement>
        <snapshotRepository>
            <id>ossrh</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots</url>
        </snapshotRepository>
    </distributionManagement>

    <properties>
        <revision>2.5.4</revision>
        <maven.compiler.source>8</maven.compiler.source>
        <maven.compiler.target>8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <skip.maven.deploy>false</skip.maven.deploy>

        <!--for Core-->
        <grpc.version>1.59.1</grpc.version>
        <protobuf.version>3.24.0</protobuf.version>
        <protoc.version>3.24.0</protoc.version>
        <commons-collections4.version>4.3</commons-collections4.version>
        <versio.maven.deploy.plugin>2.8.2</versio.maven.deploy.plugin>
        <versio.maven.source.plugin>3.2.1</versio.maven.source.plugin>
        <javax.annotation.version>1.2</javax.annotation.version>
        <commons.text.version>1.10.0</commons.text.version>
        <slf4j.api.version>1.7.36</slf4j.api.version>
        <junit.version>4.13.2</junit.version>
        <junit.jupiter.version>5.10.1</junit.jupiter.version>
        <lombok.version>1.18.22</lombok.version>
        <okhttp.version>4.12.0</okhttp.version>
        <maven.source.plugin.version>3.1.0</maven.source.plugin.version>
        <maven.javadoc.plugin.version>3.7.0</maven.javadoc.plugin.version>
        <os.maven.plugin.version>1.6.2</os.maven.plugin.version>
        <maven.release.plugin.version>2.5.3</maven.release.plugin.version>
        <protobuf.maven.plugin.version>0.6.1</protobuf.maven.plugin.version>
        <maven.enforcer.plugin.version>3.0.0-M2</maven.enforcer.plugin.version>
        <maven.surefire.plugin.version>2.19.1</maven.surefire.plugin.version>
        <maven.flatten.plugin.version>1.6.0</maven.flatten.plugin.version>
        <maven.deploy.plugin.version>3.1.3</maven.deploy.plugin.version>
        <junit.platform.version>1.1.0</junit.platform.version>
        <junit.jupiter.engine.version>5.10.1</junit.jupiter.engine.version>
        <gson.version>2.10.1</gson.version>
        <kotlin.version>1.9.10</kotlin.version>
        <mockito.version>4.11.0</mockito.version>
        <testcontainers.version>1.19.8</testcontainers.version>
        <apache.commons.pool2.version>2.12.0</apache.commons.pool2.version>
        <guava.version>32.1.3-jre</guava.version>
        <errorprone.version>2.21.1</errorprone.version>

        <!--for BulkWriter-->
        <plexus.version>3.0.24</plexus.version>
        <hadoop.version>3.3.6</hadoop.version>
        <hbase.version>1.2.0</hbase.version>
        <parquet.version>1.13.1</parquet.version>
        <unirest.version>3.13.10</unirest.version>
        <snappy.version>1.1.10.5</snappy.version>
        <aws-java-sdk-s3.version>1.12.687</aws-java-sdk-s3.version>
        <minio-java-sdk.veresion>8.5.7</minio-java-sdk.veresion>
        <azure-java-blob-sdk.version>12.25.3</azure-java-blob-sdk.version>
        <azure-java-identity-sdk.version>1.10.1</azure-java-identity-sdk.version>
    </properties>

    <profiles>
        <profile>
            <id>release</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-source-plugin</artifactId>
                        <version>${maven.source.plugin.version}</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>${maven.javadoc.plugin.version}</version>
                        <configuration>
                            <javadocExecutable>/usr/bin/javadoc</javadocExecutable>
                            <!--                            <additionalOptions>-Xdoclint:none</additionalOptions>-->
                            <additionalJOption>-Xdoclint:none</additionalJOption>
                        </configuration>
                        <executions>
                            <execution>
                                <id>attach-javadocs</id>
                                <goals>
                                    <goal>jar</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-gpg-plugin</artifactId>
                        <version>1.6</version>
                        <executions>
                            <execution>
                                <id>sign-artifacts</id>
                                <phase>verify</phase>
                                <goals>
                                    <goal>sign</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
        <extensions>
            <extension>
                <groupId>kr.motd.maven</groupId>
                <artifactId>os-maven-plugin</artifactId>
                <version>${os.maven.plugin.version}</version>
            </extension>
        </extensions>
        <plugins>
            <plugin>
                <groupId>org.sonatype.plugins</groupId>
                <artifactId>nexus-staging-maven-plugin</artifactId>
                <version>1.6.8</version>
                <extensions>true</extensions>
                <configuration>
                    <serverId>ossrh</serverId>
                    <nexusUrl>https://oss.sonatype.org/</nexusUrl>
                    <autoReleaseAfterClose>true</autoReleaseAfterClose>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>${maven.release.plugin.version}</version>
                <configuration>
                    <autoVersionSubmodules>true</autoVersionSubmodules>
                    <useReleaseProfile>false</useReleaseProfile>
                    <releaseProfiles>release</releaseProfiles>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.xolstice.maven.plugins</groupId>
                <artifactId>protobuf-maven-plugin</artifactId>
                <version>${protobuf.maven.plugin.version}</version>
                <configuration>
                    <protoSourceRoot>src/main/milvus-proto/proto</protoSourceRoot>
                    <protocArtifact>com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier}</protocArtifact>
                    <pluginId>grpc-java</pluginId>
                    <pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>compile</goal>
                            <goal>compile-custom</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-enforcer-plugin</artifactId>
                <version>${maven.enforcer.plugin.version}</version>
                <executions>
                    <execution>
                        <id>enforce</id>
                        <configuration>
                            <rules>
                                <requireUpperBoundDeps/>
                            </rules>
                        </configuration>
                        <goals>
                            <goal>enforce</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <!-- JUnit5 tests are not running with maven 3.6.x
            https://dzone.com/articles/why-your-junit-5-tests-are-not-running-under-maven
            -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>${maven.surefire.plugin.version}</version>
                <configuration>
                    <skipTests>false</skipTests>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.junit.platform</groupId>
                        <artifactId>junit-platform-surefire-provider</artifactId>
                        <version>${junit.platform.version}</version>
                    </dependency>
                    <dependency>
                        <groupId>org.junit.jupiter</groupId>
                        <artifactId>junit-jupiter-engine</artifactId>
                        <version>${junit.jupiter.engine.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>flatten-maven-plugin</artifactId>
                <version>${maven.flatten.plugin.version}</version>
                <configuration>
                    <updatePomFile>true</updatePomFile>
                    <flattenMode>oss</flattenMode>
                </configuration>
                <executions>
                    <execution>
                        <id>flatten</id>
                        <goals>
                            <goal>flatten</goal>
                        </goals>
                        <phase>process-resources</phase>
                    </execution>
                    <execution>
                        <id>flatten.clean</id>
                        <goals>
                            <goal>clean</goal>
                        </goals>
                        <phase>clean</phase>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <version>${maven.deploy.plugin.version}</version>
                <configuration>
                    <skip>${skip.maven.deploy}</skip>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>