<?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>com.github.testng-team</groupId>
  <artifactId>testng-junit5</artifactId>
  <version>0.0.1</version>
  <packaging>jar</packaging>

  <name>TestNG TestEngine</name>
  <description>Implementation of the JUnit5 Platform TestEngine interface</description>
  <url>https://github.com/testng-team/testng-junit5</url>
  <scm>
    <connection>scm:git:https://github.com/testng-team/testng-junit5</connection>
    <developerConnection>scm:git:git@github.com:testng-team/testng-junit5.git</developerConnection>
    <url>https://github.com/testng-team/testng-junit5</url>
    <tag>v0.0.1</tag>
  </scm>

  <organization>
    <name>TestNG Team</name>
    <url>https://github.com/testng-team</url>
  </organization>
  <developers>
    <developer>
      <id>juherr</id>
      <name>Julien Herr</name>
      <email>julien@herr.fr</email>
    </developer>
    <developer>
      <id>sormuras</id>
      <name>Christian Stein</name>
      <email>sormuras@gmail.com</email>
    </developer>
    <developer>
      <name>Cedric Beust</name>
    </developer>
    <developer>
      <name>Krishnana Mahadevan</name>
    </developer>
  </developers>
  <licenses>
    <license>
      <name>Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <junit.platform.version>1.5.0</junit.platform.version>
    <junit.jupiter.version>5.5.0</junit.jupiter.version>
    <testng.version>7.0.0</testng.version>
  </properties>

  <dependencies>
    <!-- Compile and runtime dependencies -->
    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>${testng.version}</version>
    </dependency>
    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-engine</artifactId>
      <version>${junit.platform.version}</version>
    </dependency>
    <!-- Test-only dependencies -->
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>${junit.jupiter.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.8.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-invoker-plugin</artifactId>
          <version>3.2.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.1.2</version>
        </plugin>
        <plugin>
          <groupId>com.coveo</groupId>
          <artifactId>fmt-maven-plugin</artifactId>
          <version>2.9</version>
        </plugin>
      </plugins>
    </pluginManagement>
    <plugins>
      <!-- Check and apply Google Java Format -->
      <plugin>
        <groupId>com.coveo</groupId>
        <artifactId>fmt-maven-plugin</artifactId>
        <configuration>
          <additionalSourceDirectories>
            <param>src/it</param>
          </additionalSourceDirectories>
        </configuration>
        <executions>
          <execution>
            <id>check</id>
            <phase>initialize</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- Launch JUnit Platform directly -->
      <plugin>
        <groupId>de.sormuras.junit</groupId>
        <artifactId>junit-platform-maven-plugin</artifactId>
        <version>1.0.0-M5</version>
        <extensions>true</extensions>
        <configuration>
          <executor>JAVA</executor>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
        <version>2.5.3</version>
        <configuration>
          <tagNameFormat>v@{project.version}</tagNameFormat>
          <autoVersionSubmodules>true</autoVersionSubmodules>
          <releaseProfiles>releases</releaseProfiles>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <!-- Google Java Format -->
    <profile>
      <id>run-fmt</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.coveo</groupId>
            <artifactId>fmt-maven-plugin</artifactId>
            <configuration>
              <additionalSourceDirectories>
                <param>src/it</param>
              </additionalSourceDirectories>
            </configuration>
            <executions>
              <execution>
                <id>format</id>
                <phase>validate</phase>
                <goals>
                  <goal>format</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <!-- Integration tests -->
    <profile>
      <id>run-its</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-invoker-plugin</artifactId>
            <configuration>
              <debug>true</debug>
              <addTestClassPath>true</addTestClassPath>
              <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
              <pomIncludes>
                <pomInclude>*/pom.xml</pomInclude>
              </pomIncludes>
              <postBuildHookScript>verify</postBuildHookScript>
              <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
              <settingsFile>src/it/settings.xml</settingsFile>
              <goals>
                <goal>clean</goal>
                <goal>test</goal>
              </goals>
            </configuration>
            <executions>
              <execution>
                <id>integration-test</id>
                <goals>
                  <goal>install</goal>
                  <goal>integration-test</goal>
                  <goal>verify</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>releases</id>
      <build>
        <pluginManagement>
          <plugins>
            <plugin>
              <artifactId>maven-deploy-plugin</artifactId>
              <configuration>
                <skip>true</skip>
              </configuration>
            </plugin>
          </plugins>
        </pluginManagement>
        <plugins>
          <plugin>
            <artifactId>maven-source-plugin</artifactId>
            <version>3.1.0</version>
            <executions>
              <execution>
                <id>sources</id>
                <configuration>
                  <forceCreation>true</forceCreation>
                </configuration>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>3.1.1</version>
            <executions>
              <execution>
                <id>javadoc</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.8</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>oss.sonatype.org</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <description>${project.version}</description>
            </configuration>
            <executions>
              <execution>
                <id>default-deploy</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                  <goal>release</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
  <distributionManagement>
    <repository>
      <id>oss.sonatype.org</id>
      <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>oss.sonatype.org</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>
</project>
