<?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>
  <version>1.0.6</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>http://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>11</java.version>
    <mockserver.version>5.15.0</mockserver.version>
    <junit-jupiter.version>5.12.2</junit-jupiter.version>
    <awaitility.version>4.3.0</awaitility.version>
    <system-stubs-jupiter.version>2.1.8</system-stubs-jupiter.version>
    <maven-compiler-plugin.version>3.14.0</maven-compiler-plugin.version>
    <maven-jar-plugin.version>3.4.2</maven-jar-plugin.version>
    <exec-maven-plugin.version>3.5.0</exec-maven-plugin.version>
    <maven-dependency-plugin.version>3.8.1</maven-dependency-plugin.version>
    <maven-source-plugin.version>3.3.1</maven-source-plugin.version>
    <maven-javadoc-plugin.version>3.11.2</maven-javadoc-plugin.version>
    <maven-deploy-plugin.version>3.1.4</maven-deploy-plugin.version>
    <maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
    <maven-enforcer-plugin.version>3.5.0</maven-enforcer-plugin.version>
    <maven-release-plugin.version>3.1.1</maven-release-plugin.version>
    <maven-gpg-plugin.version>3.2.7</maven-gpg-plugin.version>
    <central-publishing-maven-plugin.version>0.7.0</central-publishing-maven-plugin.version>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.mock-server</groupId>
      <artifactId>mockserver-netty</artifactId>
      <classifier>jar-with-dependencies</classifier>
      <scope>provided</scope>
      <version>${mockserver.version}</version>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
      <version>${junit-jupiter.version}</version>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>${awaitility.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>
  </dependencies>

  <build>
    <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>
                <requireMavenVersion>
                  <version>3.6.3</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-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.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>${maven-release-plugin.version}</version>
        <configuration>
          <useReleaseProfile>false</useReleaseProfile>
          <goals>deploy</goals>
        </configuration>
      </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>

  <profiles>
    <profile>
      <id>docker</id>
      <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>opentmf-mockserver-1.0.6</tag>
  </scm>

</project>
