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

  <groupId>org.wiremock.integrations.testcontainers</groupId>
  <artifactId>wiremock-testcontainers-module</artifactId>
  <name>WireMock module for Testcontainers Java</name>
  <description>This Testcontainers module allows provisioning the WireMock server as a standalone container within your unit tests, based on WireMock Docker</description>
  <url>https://github.com/wiremock/wiremock-testcontainers-java</url>
  <version>1.0-alpha-13</version>

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

  <developers>
    <developer>
      <id>oleg-nenashev</id> <!-- OSSRH -->
      <name>Oleg Nenashev</name>
      <url>https://github.com/oleg-nenashev/</url>
      <timezone>CEST</timezone>
      <organization>WireMock Inc.</organization>
      <organizationUrl>https://www.wiremock.io/</organizationUrl>
    </developer>
  </developers>

  <properties>
    <java.version>1.8</java.version>
    <maven.compiler.target>${java.version}</maven.compiler.target>
    <maven.compiler.source>${java.version}</maven.compiler.source>
    <wiremock.version>2.35.0</wiremock.version>
    <testcontainers.version>1.19.1</testcontainers.version>
    <junit.version>5.10.0</junit.version>
    <assertj.version>3.24.2</assertj.version>
    <awaitility.version>4.2.0</awaitility.version>
    <project.scm.id>github</project.scm.id>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.testcontainers</groupId>
        <artifactId>testcontainers-bom</artifactId>
        <version>${testcontainers.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>${junit.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <groupId>org.assertj</groupId>
        <artifactId>assertj-bom</artifactId>
        <version>${assertj.version}</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
      <dependency>
        <!-- Fix dependency convergence [logback-classic vs junit] -->
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>2.0.9</version>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>testcontainers</artifactId>
    </dependency>
    <dependency>
      <groupId>org.testcontainers</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</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.junit.vintage</groupId>
      <artifactId>junit-vintage-engine</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.awaitility</groupId>
      <artifactId>awaitility</artifactId>
      <version>${awaitility.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>ch.qos.logback</groupId>
      <artifactId>logback-classic</artifactId>
      <version>1.3.7</version>
      <scope>provided</scope>
      <optional>true</optional>
    </dependency>
  </dependencies>


  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.11.0</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.2.1</version>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.3.0</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>3.6.0</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

      <!-- For testing WireMock extensions -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>3.6.1</version>
        <executions>
          <execution>
            <id>copy</id>
            <phase>compile</phase>
            <goals>
              <goal>copy</goal>
            </goals>
            <configuration>
              <artifactItems>
                <artifactItem>
                  <groupId>com.ninecookies.wiremock.extensions</groupId>
                  <artifactId>wiremock-extensions</artifactId>
                  <version>0.4.1</version>
                  <classifier>jar-with-dependencies</classifier>
                </artifactItem>
                <dependency>
                  <groupId>org.wiremock</groupId>
                  <artifactId>wiremock-webhooks-extension</artifactId>
                  <version>2.35.0</version>
                </dependency>
              </artifactItems>
              <outputDirectory>${project.build.directory}/test-wiremock-extension</outputDirectory>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <configuration combine.children="append">
          <tagNameFormat>@{project.version}</tagNameFormat>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <!-- For testing WireMock extensions -->
  <repositories>
    <repository>
      <id>9c-releases</id>
      <url>https://raw.github.com/9cookies/mvn-repo/master/releases/</url>
      <releases>
        <enabled>true</enabled>
        <updatePolicy>always</updatePolicy>
      </releases>
    </repository>
  </repositories>

  <scm>
    <connection>scm:git:git://github.com/wiremock/wiremock-testcontainers-java.git</connection>
    <developerConnection>scm:git:https://github.com/wiremock/wiremock-testcontainers-java.git</developerConnection>
    <url>https://github.com/wiremock/wiremock-testcontainers-java</url>
    <tag>${scmTag}</tag>
  </scm>

  <distributionManagement>
    <repository>
      <id>github</id>
      <name>GitHub Packages</name>
      <url>https://maven.pkg.github.com/wiremock/wiremock-testcontainers-java</url>
    </repository>
  </distributionManagement>

  <profiles>
    <profile>
      <id>release</id>
      <properties>
          <version.maven-release-plugin>3.0.1</version.maven-release-plugin>
          <version.maven-gpg-plugin>3.1.0</version.maven-gpg-plugin>
      </properties>
      <build>
          <pluginManagement>
              <plugins>
                  <plugin>
                      <artifactId>maven-release-plugin</artifactId>
                      <version>${version.maven-release-plugin}</version>
                      <configuration>
                          <tagNameFormat>@{project.version}</tagNameFormat>
                      </configuration>
                  </plugin>
                  <!-- The key's name & passphrase are configured via GitHub's setup-java action. -->
                  <plugin>
                      <artifactId>maven-gpg-plugin</artifactId>
                      <version>${version.maven-gpg-plugin}</version>
                      <executions>
                          <execution>
                              <id>sign-artifacts</id>
                              <phase>verify</phase>
                              <goals>
                                  <goal>sign</goal>
                              </goals>
                              <configuration>
                                  <!-- This is required to make sure the plugin does not stop asking for -->
                                  <!-- user input on the passphrase -->
                                  <gpgArguments>
                                      <arg>--pinentry-mode</arg>
                                      <arg>loopback</arg>
                                  </gpgArguments>
                              </configuration>
                          </execution>
                      </executions>
                  </plugin>
              </plugins>
          </pluginManagement>
          <plugins>
              <plugin>
                  <artifactId>maven-gpg-plugin</artifactId>
              </plugin>
          </plugins>
      </build>
    </profile>
        <profile>
      <id>mavencentral-release</id>
      <properties>
          <version.nexus-staging-maven-plugin>1.6.13</version.nexus-staging-maven-plugin>
      </properties>
      <distributionManagement>
        <repository>
          <id>ossrh</id>
          <name>Central Repository OSSRH</name>
          <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
      </distributionManagement>
      <build>
          <pluginManagement>
              <plugins>
                  <plugin>
                      <groupId>org.sonatype.plugins</groupId>
                      <artifactId>nexus-staging-maven-plugin</artifactId>
                      <version>${version.nexus-staging-maven-plugin}</version>
                      <extensions>true</extensions>
                      <configuration>
                          <serverId>ossrh</serverId>
                          <nexusUrl>https://oss.sonatype.org</nexusUrl>
                          <autoReleaseAfterClose>true</autoReleaseAfterClose>
                      </configuration>
                  </plugin>
              </plugins>
          </pluginManagement>
          <plugins>
              <plugin>
                  <groupId>org.sonatype.plugins</groupId>
                  <artifactId>nexus-staging-maven-plugin</artifactId>
              </plugin>
          </plugins>
      </build>
    </profile>
  </profiles>
</project>
