<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>cloud.nstart.terravault.ordinis</groupId>
  <artifactId>ordinis-parent</artifactId>
  <version>0.1.0-SNAPSHOT</version>
  <packaging>pom</packaging>

  <name>Ordinis (parent)</name>
  <description>MDM сервис для НСИ ЦУОД ОДХ. Часть линейки Terravault.</description>

  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.4.2</version>
    <relativePath/>
  </parent>

  <modules>
    <module>ordinis-domain</module>
    <module>ordinis-validation</module>
    <module>ordinis-events-api</module>
    <module>ordinis-outbox</module>
    <module>ordinis-auth</module>
    <module>ordinis-rest-api</module>
    <module>ordinis-app</module>
    <module>ordinis-read-api</module>
    <module>ordinis-projection-writer</module>
    <module>ordinis-cuod-bundle</module>
    <module>ordinis-migrations</module>
    <module>ordinis-notifications</module>
  </modules>

  <!--
    ordinis-bench (JMH microbenchmarks) gated behind `bench` profile —
    не строится при обычном `mvn package` чтобы не замедлять CI.
    Активация: `mvn -P bench -pl ordinis-bench -am package`.
  -->
  <profiles>
    <profile>
      <id>bench</id>
      <modules>
        <module>ordinis-bench</module>
      </modules>
    </profile>
  </profiles>

  <properties>
    <java.version>21</java.version>
    <maven.compiler.source>21</maven.compiler.source>
    <maven.compiler.target>21</maven.compiler.target>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

    <spring-cloud.version>2024.0.0</spring-cloud.version>
    <spring-cloud-vault.version>4.2.0</spring-cloud-vault.version>
    <hypersistence-utils.version>3.9.0</hypersistence-utils.version>
    <json-schema-validator.version>1.5.4</json-schema-validator.version>
    <postgis-jdbc.version>2024.1.0</postgis-jdbc.version>
    <logstash-logback.version>8.0</logstash-logback.version>
    <opentelemetry-instrumentation.version>2.10.0</opentelemetry-instrumentation.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-dependencies</artifactId>
        <version>${spring-cloud.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>

      <!-- Internal modules -->
      <dependency>
        <groupId>cloud.nstart.terravault.ordinis</groupId>
        <artifactId>ordinis-domain</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>cloud.nstart.terravault.ordinis</groupId>
        <artifactId>ordinis-validation</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>cloud.nstart.terravault.ordinis</groupId>
        <artifactId>ordinis-events-api</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>cloud.nstart.terravault.ordinis</groupId>
        <artifactId>ordinis-outbox</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>cloud.nstart.terravault.ordinis</groupId>
        <artifactId>ordinis-auth</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>cloud.nstart.terravault.ordinis</groupId>
        <artifactId>ordinis-rest-api</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>cloud.nstart.terravault.ordinis</groupId>
        <artifactId>ordinis-cuod-bundle</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>cloud.nstart.terravault.ordinis</groupId>
        <artifactId>ordinis-migrations</artifactId>
        <version>${project.version}</version>
      </dependency>
      <dependency>
        <groupId>cloud.nstart.terravault.ordinis</groupId>
        <artifactId>ordinis-notifications</artifactId>
        <version>${project.version}</version>
      </dependency>

      <!-- External -->
      <dependency>
        <groupId>io.hypersistence</groupId>
        <artifactId>hypersistence-utils-hibernate-63</artifactId>
        <version>${hypersistence-utils.version}</version>
      </dependency>
      <dependency>
        <groupId>com.networknt</groupId>
        <artifactId>json-schema-validator</artifactId>
        <version>${json-schema-validator.version}</version>
      </dependency>
      <dependency>
        <groupId>net.postgis</groupId>
        <artifactId>postgis-jdbc</artifactId>
        <version>${postgis-jdbc.version}</version>
      </dependency>
      <dependency>
        <groupId>net.logstash.logback</groupId>
        <artifactId>logstash-logback-encoder</artifactId>
        <version>${logstash-logback.version}</version>
      </dependency>
      <dependency>
        <groupId>io.opentelemetry.instrumentation</groupId>
        <artifactId>opentelemetry-spring-boot-starter</artifactId>
        <version>${opentelemetry-instrumentation.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <!-- Тестовые зависимости — common для всех модулей.
       spring-boot-starter-test тянет JUnit 5, Mockito, AssertJ, Hamcrest. -->
  <dependencies>
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-test</artifactId>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-maven-plugin</artifactId>
          <configuration>
            <excludes>
              <exclude>
                <groupId>org.projectlombok</groupId>
                <artifactId>lombok</artifactId>
              </exclude>
            </excludes>
          </configuration>
        </plugin>
      </plugins>
    </pluginManagement>
  </build>
</project>
