<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>tech.ydb</groupId>
    <version>2.3.3</version>
    <artifactId>ydb-sdk-bom</artifactId>
    <name>Java SDK Bill of Materials</name>
    <description>Java SDK Bill of Materials (BOM)</description>
    <packaging>pom</packaging>
    <url>https://github.com/ydb-platform/ydb-java-sdk</url>

    <properties>
        <ydb-auth-api.version>1.0.0</ydb-auth-api.version>
        <ydb-proto-api.version>1.6.4</ydb-proto-api.version>
        <yc-auth.version>2.2.0</yc-auth.version>
    </properties>

    <licenses>
        <license>
            <name>Apache License, Version 2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0</url>
        </license>
    </licenses>

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

    <developers>
        <developer>
            <name>Aleksandr Gorshenin</name>
            <email>alexandr268@ydb.tech</email>
            <organization>YDB</organization>
            <organizationUrl>https://ydb.tech/</organizationUrl>
        </developer>
    </developers>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>tech.ydb</groupId>
                <artifactId>ydb-proto-api</artifactId>
                <version>${ydb-proto-api.version}</version>
            </dependency>

            <dependency>
                <groupId>tech.ydb</groupId>
                <artifactId>ydb-auth-api</artifactId>
                <version>${ydb-auth-api.version}</version>
            </dependency>

            <dependency>
                <groupId>tech.ydb</groupId>
                <artifactId>ydb-sdk-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>tech.ydb</groupId>
                <artifactId>ydb-sdk-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>tech.ydb</groupId>
                <artifactId>ydb-sdk-table</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>tech.ydb</groupId>
                <artifactId>ydb-sdk-scheme</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>tech.ydb</groupId>
                <artifactId>ydb-sdk-topic</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>tech.ydb</groupId>
                <artifactId>ydb-sdk-export</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>tech.ydb</groupId>
                <artifactId>ydb-sdk-coordination</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>tech.ydb</groupId>
                <artifactId>ydb-sdk-query</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>tech.ydb.test</groupId>
                <artifactId>ydb-tests-common</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>tech.ydb.test</groupId>
                <artifactId>ydb-junit4-support</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>tech.ydb.test</groupId>
                <artifactId>ydb-junit5-support</artifactId>
                <version>${project.version}</version>
            </dependency>

            <dependency>
                <groupId>tech.ydb.auth</groupId>
                <artifactId>ydb-oauth2-provider</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>tech.ydb.auth</groupId>
                <artifactId>yc-auth-provider</artifactId>
                <version>${yc-auth.version}</version>
                <!-- Exclude grpc dependencies to avoid conflict with ydb-proto-api -->
                <exclusions>
                    <exclusion>
                        <groupId>io.grpc</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.google.protobuf</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>tech.ydb.auth</groupId>
                <artifactId>yc-auth-provider-shaded</artifactId>
                <version>${yc-auth.version}</version>
                <!-- Exclude grpc dependencies to avoid conflict with ydb-proto-api -->
                <exclusions>
                    <exclusion>
                        <groupId>io.grpc</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.google.protobuf</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.12.1</version>
                <configuration>
                    <target>1.8</target>
                    <source>1.8</source>
                    <compilerArgs>
                        <arg>-Xlint</arg>
                        <!-- Silence warning "No processor claimed any of these annotations". One of the
                        annotations that would trigger it is org.junit.jupiter.api.Test -->
                        <arg>-Xlint:-processing</arg>
                    </compilerArgs>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <profile>
            <id>jdk8-bootstrap</id>
            <activation>
                <jdk>[9</jdk>
            </activation>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-compiler-plugin</artifactId>
                        <configuration>
                            <release>8</release>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <id>ossrh-s01</id>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>

            <build>
                <plugins>
                    <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>
                        <configuration>
                            <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.8</version>
                        <extensions>true</extensions>
                        <configuration>
                            <serverId>ossrh-s01</serverId>
                            <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
                            <autoReleaseAfterClose>false</autoReleaseAfterClose>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>
