<?xml version="1.0" encoding="UTF-8"?>
<!--
 ~  Copyright 2021 Red Hat, Inc.
 ~
 ~  Licensed 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>

    <parent>
        <groupId>io.smallrye</groupId>
        <artifactId>smallrye-parent</artifactId>
        <version>31</version>
    </parent>

    <groupId>io.smallrye.stork</groupId>
    <artifactId>smallrye-stork-parent</artifactId>
    <version>1.0.0.Alpha6</version>

    <packaging>pom</packaging>
    <name>SmallRye Service Discovery : Parent</name>
    <url>http://smallrye.io</url>

    <properties>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>

        <version.assertj>3.21.0</version.assertj>
        <version.microprofile-config-api>2.0</version.microprofile-config-api>
        <version.mutiny>1.0.0</version.mutiny>
        <version.smallrye-config>2.5.0</version.smallrye-config>
        <vertx.version>4.1.4</vertx.version>
        <kubernetes-client.version>5.7.3</kubernetes-client.version>
        <version.slf4j>1.7.32</version.slf4j>

        <jandex-maven-plugin.version>1.2.0</jandex-maven-plugin.version>

        <plugin.version.failsafe>3.0.0-M5</plugin.version.failsafe>

        <sonar.projectName>SmallRye Stork</sonar.projectName>
        <sonar.projectKey>smallrye_smallrye-stork</sonar.projectKey>
        <sonar.moduleKey>${project.groupId}:${project.artifactId}</sonar.moduleKey>
    </properties>

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

    <issueManagement>
        <system>GitHub</system>
        <url>https://github.com/smallrye/smallrye-stork/issues</url>
    </issueManagement>

    <scm>
        <connection>scm:git:git@github.com:smallrye/smallrye-load-balancer.git</connection>
        <developerConnection>scm:git:git@github.com:smallrye/smallrye-load-balancer.git</developerConnection>
        <url>https://github.com/smallrye/smallrye-load-balancer/</url>
        <tag>1.0.0.Alpha6</tag>
    </scm>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.smallrye.reactive</groupId>
                <artifactId>mutiny</artifactId>
                <version>${version.mutiny}</version>
            </dependency>
            <dependency>
                <groupId>org.eclipse.microprofile.config</groupId>
                <artifactId>microprofile-config-api</artifactId>
                <version>${version.microprofile-config-api}</version>
            </dependency>
            <dependency>
                <groupId>io.smallrye.config</groupId>
                <artifactId>smallrye-config</artifactId>
                <version>${version.smallrye-config}</version>
            </dependency>
            <dependency>
                <groupId>org.assertj</groupId>
                <artifactId>assertj-core</artifactId>
                <version>${version.assertj}</version>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>${version.slf4j}</version>
            </dependency>

            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-simple</artifactId>
                <version>${version.slf4j}</version>
            </dependency>
            <dependency>
                <groupId>io.fabric8</groupId>
                <artifactId>kubernetes-client</artifactId>
                <version>${kubernetes-client.version}</version>
            </dependency>
            <dependency>
                <groupId>io.fabric8</groupId>
                <artifactId>kubernetes-server-mock</artifactId>
                <version>${kubernetes-client.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>org.testcontainers</groupId>
                <artifactId>junit-jupiter</artifactId>
                <version>${version.testcontainers}</version>
                <scope>test</scope>
            </dependency>


            <!-- Dependencies provided by the project -->
            <dependency>
                <groupId>io.smallrye.stork</groupId>
                <artifactId>smallrye-stork-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-consul-client</artifactId>
                <version>${vertx.version}</version>
            </dependency>
            <dependency>
                <groupId>io.vertx</groupId>
                <artifactId>vertx-core</artifactId>
                <version>${vertx.version}</version>
            </dependency>
            <dependency>
                <groupId>io.smallrye.stork</groupId>
                <artifactId>smallrye-stork-test-utils</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.smallrye.stork</groupId>
                <artifactId>smallrye-stork-static-list</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.smallrye.stork</groupId>
                <!--todo: name is lengthy, shorten it?-->
                <artifactId>smallrye-stork-load-balancer-round-robin</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.smallrye.stork</groupId>
                <artifactId>smallrye-stork-service-discovery-static-list</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>io.smallrye.stork</groupId>
                <artifactId>smallrye-stork-service-discovery-consul</artifactId>
                <version>${project.version}</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>${plugin.version.failsafe}</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>integration-test</goal>
                            <goal>verify</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.jboss.jandex</groupId>
                <artifactId>jandex-maven-plugin</artifactId>
                <version>${jandex-maven-plugin.version}</version>
                <executions>
                    <execution>
                        <id>make-index</id>
                        <goals>
                            <goal>jandex</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <modules>
        <module>api</module>
        <module>microprofile</module>
        <module>service-discovery/static-list</module>
        <module>service-discovery/consul</module>
        <module>service-discovery/kubernetes</module>
        <module>load-balancer/round-robin</module>
        <module>load-balancer/response-time</module>
        <module>test-utils</module>
    </modules>

    <profiles>
        <profile>
            <id>coverage</id>
            <properties>
                <argLine>@{jacocoArgLine}</argLine>
                <!--suppress UnresolvedMavenProperty -->
                <sonar.coverage.jacoco.xmlReportPaths>
                    ${maven.multiModuleProjectDirectory}/coverage/target/site/jacoco-aggregate/jacoco.xml
                </sonar.coverage.jacoco.xmlReportPaths>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.jacoco</groupId>
                        <artifactId>jacoco-maven-plugin</artifactId>
                    </plugin>
                </plugins>
            </build>
            <modules>
                <module>coverage</module>
            </modules>
        </profile>
    </profiles>
</project>
