<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ SPDX-FileCopyrightText: 2017-2024 Enedis
  ~
  ~ SPDX-License-Identifier: Apache-2.0
  ~
  -->

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         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>com.chutneytesting</groupId>
        <artifactId>chutney-testing-parent</artifactId>
        <version>3.0.0</version>
    </parent>

    <artifactId>chutney-parent</artifactId>
    <packaging>pom</packaging>

    <name>Chutney</name>
    <url>https://github.com/chutney-testing/chutney</url>
    <description>An opinionated test application to help you practice Specification by Example.</description>
    <inceptionYear>2017</inceptionYear>

    <licenses>
        <license>
            <name>Apache-2.0</name>
            <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
            <distribution>repo</distribution>
        </license>
    </licenses>

    <modules>
        <module>server</module>
        <module>server-core</module>
        <module>ui</module>
        <module>engine</module>
        <module>action-spi</module>
        <module>action-impl</module>
        <module>environment</module>
        <module>tools</module>
        <module>packaging</module>
        <module>jira</module>
    </modules>

    <properties>

        <!-- Runtime dependencies versions -->
        <springboot.version>3.2.1</springboot.version>
        <guava.version>31.0.1-jre</guava.version> <!-- Divergence on dependencies checker-qual and error_prone_annotations --> <!-- Test on https://github.com/FasterXML/jackson-datatypes-collections/tree/2.14/guava -->

        <mapstruct.version>1.6.2</mapstruct.version>
        <immutables.version>2.10.0</immutables.version>
        <commonstext.version>1.12.0</commonstext.version>
        <commonsio.version>2.17.0</commonsio.version>
        <hjson.version>3.1.0</hjson.version>
        <jsr305.version>3.0.2</jsr305.version>
        <liquibase.version>4.29.2</liquibase.version>

        <!-- action-impl dependencies versions -->
        <sshj.version>0.39.0</sshj.version>
        <sshd.version>2.14.0</sshd.version>
        <qpid-broker.version>9.2.0</qpid-broker.version>
        <radius.version>1.1.3</radius.version> <!-- Divergence on dependency commons-logging -->
        <wss4j.version>1.6.19</wss4j.version> <!-- Divergence on dependencies xmlsec, commons-logging and joda-time-->
        <org.everit.json.schema.version>1.14.1</org.everit.json.schema.version> <!-- Divergence on dependencies commons-logging and joda-time -->

        <!-- action-impl test dependencies versions -->
        <activemq-junit.version>6.1.2</activemq-junit.version> <!-- = Follow spring boot version -->
        <rabbitmq-mock.version>1.2.0</rabbitmq-mock.version>

        <!-- test dependencies versions -->
        <jqwik.version>1.9.1</jqwik.version>
        <wiremock.version>3.9.1</wiremock.version>
        <lucene.version>9.12.0</lucene.version>
    </properties>

    <dependencies>
        <!-- APT dependencies -->
        <dependency>
            <groupId>org.immutables</groupId>
            <artifactId>value</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jul-to-slf4j</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>log4j-over-slf4j</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>jcl-over-slf4j</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-params</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.assertj</groupId>
            <artifactId>assertj-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.awaitility</groupId>
            <artifactId>awaitility</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.chutneytesting</groupId>
                <artifactId>server</artifactId>
                <version>${project.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.chutneytesting</groupId>
                <artifactId>server-core</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.chutneytesting</groupId>
                <artifactId>environment</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.chutneytesting</groupId>
                <artifactId>jira</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.chutneytesting</groupId>
                <artifactId>ui</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.chutneytesting</groupId>
                <artifactId>engine</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.chutneytesting</groupId>
                <artifactId>action-spi</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.chutneytesting</groupId>
                <artifactId>action-impl</artifactId>
                <version>${project.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>com.fasterxml.jackson.module</groupId>
                        <artifactId>jackson-module-scala_2.13</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>com.chutneytesting</groupId>
                <artifactId>chutney-junit-api</artifactId>
                <version>${project.version}</version>
            </dependency>
            <dependency>
                <groupId>com.chutneytesting</groupId>
                <artifactId>tools</artifactId>
                <version>${project.version}</version>
            </dependency>

            <!-- APT dependencies -->
            <dependency>
                <groupId>org.immutables</groupId>
                <artifactId>value</artifactId>
                <version>${immutables.version}</version>
                <scope>provided</scope>
            </dependency>

            <!-- Spring dependencies -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-parent</artifactId>
                <version>${springboot.version}</version>
                <type>pom</type>
                <scope>import</scope>
                <exclusions>
                    <exclusion>
                        <groupId>commons-logging</groupId>
                        <artifactId>commons-logging</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>

            <!-- External dependencies -->
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>${guava.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.commons</groupId>
                <artifactId>commons-text</artifactId>
                <version>${commonstext.version}</version>
            </dependency>
            <dependency>
                <groupId>commons-io</groupId>
                <artifactId>commons-io</artifactId>
                <version>${commonsio.version}</version>
            </dependency>
            <dependency>
                <groupId>org.hjson</groupId>
                <artifactId>hjson</artifactId>
                <version>${hjson.version}</version>
            </dependency>
            <dependency>
                <groupId>org.mapstruct</groupId>
                <artifactId>mapstruct</artifactId>
                <version>${mapstruct.version}</version>
            </dependency>
            <dependency>
                <groupId>com.google.code.findbugs</groupId>
                <artifactId>jsr305</artifactId>
                <version>${jsr305.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.sshd</groupId>
                <artifactId>sshd-core</artifactId>
                <version>${sshd.version}</version>
            </dependency>
            <dependency>
                <groupId>org.liquibase</groupId>
                <artifactId>liquibase-core</artifactId>
                <version>${liquibase.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-core</artifactId>
                <version>${lucene.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-analysis-common</artifactId>
                <version>${lucene.version}</version>
            </dependency>
            <dependency>
                <groupId>org.apache.lucene</groupId>
                <artifactId>lucene-queryparser</artifactId>
                <version>${lucene.version}</version>
            </dependency>
            <!-- Test dependencies -->
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-test</artifactId>
                <version>${springboot.version}</version>
                <scope>test</scope>
                <exclusions>
                    <exclusion>
                        <groupId>junit</groupId>
                        <artifactId>junit</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>com.vaadin.external.google</groupId>
                        <artifactId>android-json</artifactId>
                    </exclusion>
                    <exclusion>
                        <groupId>org.junit.vintage</groupId>
                        <artifactId>junit-vintage-engine</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.wiremock</groupId>
                <artifactId>wiremock-standalone</artifactId>
                <version>${wiremock.version}</version>
                <exclusions>
                    <exclusion>
                        <groupId>org.slf4j</groupId>
                        <artifactId>*</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
            <dependency>
                <groupId>org.apache.activemq.tooling</groupId>
                <artifactId>activemq-junit</artifactId>
                <version>${activemq-junit.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>com.github.fridujo</groupId>
                <artifactId>rabbitmq-mock</artifactId>
                <version>${rabbitmq-mock.version}</version>
                <scope>test</scope>
            </dependency>
            <!-- Property Based Testing -->
            <dependency>
                <groupId>net.jqwik</groupId>
                <artifactId>jqwik</artifactId>
                <version>${jqwik.version}</version>
                <scope>test</scope>
            </dependency>
            <dependency>
                <groupId>net.jqwik</groupId>
                <artifactId>jqwik-time</artifactId>
                <version>${jqwik.version}</version>
                <scope>test</scope>
            </dependency>

            <!-- Dependency Convergence -->

            <!-- Actions -->
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcpkix-jdk18on</artifactId>
                <version>1.76</version>
            </dependency>
            <dependency>
                <groupId>org.bouncycastle</groupId>
                <artifactId>bcprov-jdk18on</artifactId>
                <version>1.76</version>
            </dependency>
            <dependency>
                <groupId>io.opentelemetry</groupId>
                <artifactId>opentelemetry-sdk-logs</artifactId>
                <version>1.31.0</version>
            </dependency>
            <dependency>
                <groupId>io.opentelemetry</groupId>
                <artifactId>opentelemetry-semconv</artifactId>
                <version>1.25.0-alpha</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.santuario</groupId>
                <artifactId>xmlsec</artifactId>
                <version>1.5.8</version>
            </dependency>
            <dependency>
                <groupId>commons-logging</groupId>
                <artifactId>commons-logging</artifactId>
                <version>1.3.4</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>joda-time</groupId>
                <artifactId>joda-time</artifactId>
                <version>2.10.2</version>
            </dependency>
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-library</artifactId>
                <version>2.13.10</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-reflect</artifactId>
                <version>2.13.10</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.zookeeper</groupId>
                <artifactId>zookeeper</artifactId>
                <version>3.6.4</version>
                <scope>runtime</scope>
            </dependency>
            <dependency>
                <groupId>org.ow2.asm</groupId>
                <artifactId>asm</artifactId>
                <version>9.3</version>
            </dependency>

            <!-- Jira -->
            <dependency>
                <groupId>org.apache.httpcomponents</groupId>
                <artifactId>httpclient-cache</artifactId>
                <version>4.5.13</version>
            </dependency>

            <!-- Server -->
            <dependency>
                <groupId>org.checkerframework</groupId>
                <artifactId>checker-qual</artifactId>
                <version>3.33.0</version>
            </dependency>
            <dependency>
                <groupId>com.google.errorprone</groupId>
                <artifactId>error_prone_annotations</artifactId>
                <version>2.18.0</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.13.0</version>
                    <configuration>
                        <forceLegacyJavacApi>true</forceLegacyJavacApi>
                        <parameters>true</parameters>
                        <annotationProcessorPaths>
                            <path>
                                <groupId>org.immutables</groupId>
                                <artifactId>value</artifactId>
                                <version>${immutables.version}</version>
                            </path>
                            <path>
                                <groupId>org.mapstruct</groupId>
                                <artifactId>mapstruct-processor</artifactId>
                                <version>${mapstruct.version}</version>
                            </path>
                        </annotationProcessorPaths>
                    </configuration>
                </plugin>
                <plugin>
                    <!-- This plugin isn't strictly necessary; without it the generated
              sources are compiled just fine. It's here to make importing the project
              into Eclipse using M2Eclipse a much smoother process. Thanks to this
              configuration users won't have to manually add each generated source
              directory to the build path. -->
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>build-helper-maven-plugin</artifactId>
                    <version>3.6.0</version>
                    <executions>
                        <execution>
                            <id>add-source</id>
                            <goals>
                                <goal>add-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>${project.build.directory}/generated-sources/annotations</source>
                                    <source>${project.build.directory}/generated-sources/jaxb</source>
                                </sources>
                            </configuration>
                        </execution>
                        <execution>
                            <id>add-test-source</id>
                            <goals>
                                <goal>add-test-source</goal>
                            </goals>
                            <configuration>
                                <sources>
                                    <source>${project.build.directory}/generated-test-sources/test-annotations</source>
                                </sources>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
