<?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>org.opentmf.mockserver</groupId>
  <artifactId>opentmf-mockserver</artifactId>
  <name>opentmf-mockserver</name>
  <version>2.1.5</version>

  <description>
    Easy to use dynamic expectations for get, list, post, patch, delete and token retrieval.
  </description>

  <url>https://github.com/opentmf/opentmf-mockserver</url>

  <organization>
    <name>PiA Group</name>
    <url>https://www.pia-group.net/</url>
  </organization>

  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
      <comments>A permissive open-source license</comments>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>gokhanus</id>
      <name>Gokhan Demir</name>
      <email>gokhan@opentmf.org</email>
    </developer>
    <developer>
      <id>yusuf-bozkurt</id>
      <name>Yusuf Bozkurt</name>
      <email>yusuf.bozkurt@pia-team.com</email>
    </developer>
    <developer>
      <id>cezmi-aslan</id>
      <name>Cezmi Aslan</name>
      <email>cezmi.aslan@pia-team.com</email>
    </developer>
    <developer>
      <id>abdullahbeker</id>
      <name>Abdullah Beker</name>
      <email>abdullah.beker@dnext-technology.com</email>
    </developer>
  </developers>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>17</java.version>

    <!-- Core runtime -->
    <jackson.version>3.2.0</jackson.version>
    <netty.version>4.2.15.Final</netty.version>
    <netty-tcnative.version>2.0.79.Final</netty-tcnative.version>
    <bouncycastle.version>1.84</bouncycastle.version>
    <nimbus-jose-jwt.version>10.9.1</nimbus-jose-jwt.version>
    <json-schema-validator.version>3.0.4</json-schema-validator.version>
    <json-path.version>3.0.0</json-path.version>
    <opentmf-json-patch.version>1.1.0</opentmf-json-patch.version>
    <disruptor.version>4.0.0</disruptor.version>
    <jzlib.version>1.1.3</jzlib.version>
    <jsr305.version>3.0.2</jsr305.version>
    <hypersistence-tsid.version>2.1.4</hypersistence-tsid.version>

    <!-- Utilities -->
    <commons-lang3.version>3.20.0</commons-lang3.version>
    <commons-text.version>1.15.0</commons-text.version>
    <commons-codec.version>1.22.0</commons-codec.version>
    <commons-compress.version>1.28.0</commons-compress.version>
    <guava.version>33.6.0-jre</guava.version>
    <classgraph.version>4.8.184</classgraph.version>

    <!-- Logging -->
    <slf4j.version>2.0.18</slf4j.version>

    <!-- Test -->
    <junit-jupiter.version>6.1.0</junit-jupiter.version>
    <system-stubs-jupiter.version>2.1.8</system-stubs-jupiter.version>
    <testcontainers.version>1.21.4</testcontainers.version>

    <!-- Maven plugins -->
    <maven-compiler-plugin.version>3.15.0</maven-compiler-plugin.version>
    <maven-failsafe-plugin.version>3.5.6</maven-failsafe-plugin.version>
    <maven-surefire-plugin.version>3.5.6</maven-surefire-plugin.version>
    <maven-jar-plugin.version>3.5.0</maven-jar-plugin.version>
    <exec-maven-plugin.version>3.6.3</exec-maven-plugin.version>
    <maven-dependency-plugin.version>3.11.0</maven-dependency-plugin.version>
    <maven-source-plugin.version>3.4.0</maven-source-plugin.version>
    <maven-javadoc-plugin.version>3.12.0</maven-javadoc-plugin.version>
    <maven-deploy-plugin.version>3.1.4</maven-deploy-plugin.version>
    <maven-resources-plugin.version>3.5.0</maven-resources-plugin.version>
    <maven-enforcer-plugin.version>3.6.3</maven-enforcer-plugin.version>
    <maven-release-plugin.version>3.3.1</maven-release-plugin.version>
    <maven-gpg-plugin.version>3.2.8</maven-gpg-plugin.version>
    <central-publishing-maven-plugin.version>0.11.0</central-publishing-maven-plugin.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>tools.jackson</groupId>
        <artifactId>jackson-bom</artifactId>
        <version>${jackson.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
      </dependency>
      <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-compress</artifactId>
        <version>${commons-compress.version}</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <!-- Jackson 3 -->
    <dependency>
      <groupId>tools.jackson.core</groupId>
      <artifactId>jackson-databind</artifactId>
    </dependency>

    <!-- Netty -->
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-buffer</artifactId>
      <version>${netty.version}</version>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-codec-http</artifactId>
      <version>${netty.version}</version>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-codec-http2</artifactId>
      <version>${netty.version}</version>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-common</artifactId>
      <version>${netty.version}</version>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-handler</artifactId>
      <version>${netty.version}</version>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-transport</artifactId>
      <version>${netty.version}</version>
    </dependency>
    <dependency>
      <groupId>io.netty</groupId>
      <artifactId>netty-tcnative-boringssl-static</artifactId>
      <version>${netty-tcnative.version}</version>
      <scope>runtime</scope>
    </dependency>

    <!-- TLS / Crypto -->
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcprov-jdk18on</artifactId>
      <version>${bouncycastle.version}</version>
    </dependency>
    <dependency>
      <groupId>org.bouncycastle</groupId>
      <artifactId>bcpkix-jdk18on</artifactId>
      <version>${bouncycastle.version}</version>
    </dependency>

    <!-- JWT -->
    <dependency>
      <groupId>com.nimbusds</groupId>
      <artifactId>nimbus-jose-jwt</artifactId>
      <version>${nimbus-jose-jwt.version}</version>
    </dependency>

    <!-- JSON validation and matching -->
    <dependency>
      <groupId>com.networknt</groupId>
      <artifactId>json-schema-validator</artifactId>
      <version>${json-schema-validator.version}</version>
    </dependency>
    <dependency>
      <groupId>com.jayway.jsonpath</groupId>
      <artifactId>json-path</artifactId>
      <version>${json-path.version}</version>
    </dependency>

    <!-- JSON Patch + Merge Patch (Jackson 3) -->
    <dependency>
      <groupId>org.opentmf.commons</groupId>
      <artifactId>opentmf-json-patch</artifactId>
      <version>${opentmf-json-patch.version}</version>
    </dependency>

    <!-- Async event log -->
    <dependency>
      <groupId>com.lmax</groupId>
      <artifactId>disruptor</artifactId>
      <version>${disruptor.version}</version>
    </dependency>

    <!-- Gzip (used by Netty at runtime for HTTP content compression) -->
    <dependency>
      <groupId>com.jcraft</groupId>
      <artifactId>jzlib</artifactId>
      <version>${jzlib.version}</version>
      <scope>runtime</scope>
    </dependency>

    <!-- JSR 305 annotations (@Nullable, @Nonnull) – compile-time only -->
    <dependency>
      <groupId>com.google.code.findbugs</groupId>
      <artifactId>jsr305</artifactId>
      <version>${jsr305.version}</version>
      <optional>true</optional>
    </dependency>

    <!-- TSID (Time-Sorted IDs) -->
    <dependency>
      <groupId>io.hypersistence</groupId>
      <artifactId>hypersistence-tsid</artifactId>
      <version>${hypersistence-tsid.version}</version>
    </dependency>

    <!-- Utilities -->
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>${commons-lang3.version}</version>
    </dependency>
    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-text</artifactId>
      <version>${commons-text.version}</version>
    </dependency>
    <dependency>
      <groupId>commons-codec</groupId>
      <artifactId>commons-codec</artifactId>
      <version>${commons-codec.version}</version>
    </dependency>
    <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>${guava.version}</version>
    </dependency>
    <dependency>
      <groupId>io.github.classgraph</groupId>
      <artifactId>classgraph</artifactId>
      <version>${classgraph.version}</version>
    </dependency>

    <!-- Logging -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>${slf4j.version}</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <version>${slf4j.version}</version>
      <scope>runtime</scope>
      <optional>true</optional>
    </dependency>

    <!-- Test -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${junit-jupiter.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>uk.org.webcompere</groupId>
      <artifactId>system-stubs-jupiter</artifactId>
      <version>${system-stubs-jupiter.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>testcontainers</artifactId>
      <version>${testcontainers.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>junit-jupiter</artifactId>
      <version>${testcontainers.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>false</filtering>
        <excludes>
          <exclude>mockserver-version.properties</exclude>
        </excludes>
      </resource>
      <resource>
        <directory>src/main/resources</directory>
        <filtering>true</filtering>
        <includes>
          <include>mockserver-version.properties</include>
        </includes>
      </resource>
      <resource>
        <directory>${project.basedir}</directory>
        <includes>
          <include>opentmf-mockserver-openapi.yaml</include>
        </includes>
        <filtering>true</filtering>
      </resource>
    </resources>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-resources-plugin</artifactId>
          <version>${maven-resources-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-jar-plugin</artifactId>
          <version>${maven-jar-plugin.version}</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${maven-deploy-plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>${maven-enforcer-plugin.version}</version>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireJavaVersion>
                  <version>17</version>
                </requireJavaVersion>
                <requireMavenVersion>
                  <version>3.9.0</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>${maven-compiler-plugin.version}</version>
        <configuration>
          <source>${java.version}</source>
          <target>${java.version}</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>${maven-dependency-plugin.version}</version>
        <executions>
          <execution>
            <id>copy</id>
            <phase>package</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
            <configuration>
              <includeScope>runtime</includeScope>
              <outputDirectory>${project.build.directory}/libs</outputDirectory>
              <overWriteReleases>false</overWriteReleases>
              <overWriteSnapshots>false</overWriteSnapshots>
              <overWriteIfNewer>true</overWriteIfNewer>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven-surefire-plugin.version}</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>${maven-failsafe-plugin.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>${maven-release-plugin.version}</version>
        <configuration>
          <useReleaseProfile>false</useReleaseProfile>
          <releaseProfiles>release</releaseProfiles>
          <goals>deploy</goals>
          <tagNameFormat>@{project.version}</tagNameFormat>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <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>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <goals>
                  <goal>jar</goal>
                </goals>
                <configuration>
                  <failOnWarnings>false</failOnWarnings>
                  <failOnError>false</failOnError>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>${maven-gpg-plugin.version}</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.central</groupId>
            <artifactId>central-publishing-maven-plugin</artifactId>
            <version>${central-publishing-maven-plugin.version}</version>
            <extensions>true</extensions>
            <configuration>
              <publishingServerId>publish-to-central</publishingServerId>
              <autoPublish>true</autoPublish>
            </configuration>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>docker</id>
      <properties>
        <maven.source.skip>true</maven.source.skip>
        <maven.javadoc.skip>true</maven.javadoc.skip>
        <maven.test.skip>true</maven.test.skip>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>${exec-maven-plugin.version}</version>
            <executions>
              <!-- Remove existing docker image from local repo -->
              <execution>
                <configuration>
                  <arguments>
                    <argument>image</argument>
                    <argument>rm</argument>
                    <argument>--force</argument>
                    <argument>local/opentmf-mockserver:${project.version}</argument>
                  </arguments>
                  <executable>docker</executable>
                  <workingDirectory>${project.basedir}</workingDirectory>
                </configuration>
                <goals>
                  <goal>exec</goal>
                </goals>
                <id>docker-clean</id>
                <phase>clean</phase>
              </execution>

              <!-- Create new docker image -->
              <execution>
                <configuration>
                  <arguments>
                    <argument>build</argument>
                    <argument>-t</argument>
                    <argument>local/opentmf-mockserver:${project.version}</argument>
                    <argument>--build-arg</argument>
                    <argument>VERSION=${project.version}</argument>
                    <argument>.</argument>
                  </arguments>
                  <executable>docker</executable>
                  <workingDirectory>${project.basedir}</workingDirectory>
                </configuration>
                <goals>
                  <goal>exec</goal>
                </goals>
                <id>docker-build</id>
                <phase>package</phase>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>

  <scm>
    <url>https://github.com/opentmf/opentmf-mockserver</url>
    <connection>scm:git:git@github.com:opentmf/opentmf-mockserver.git</connection>
    <developerConnection>scm:git:git@github.com:opentmf/opentmf-mockserver.git</developerConnection>
    <tag>2.1.5</tag>
  </scm>

</project>
