<?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>pl.amazingcode</groupId>
  <artifactId>threads-collider</artifactId>
  <version>1.0.1</version>
  <packaging>jar</packaging>

  <name>threads-collider</name>
  <description>Start multiple threads at "exactly" same moment for testing purposes.</description>
  <url>https://amazingcode.pl/threads-collider</url>

  <licenses>
    <license>
      <name>The Apache License, Version 2.0</name>
      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <id>pstawirej</id>
      <name>Piotr Stawirej</name>
      <email>piotr.stawirej@gmail.com</email>
      <url>https://amazingcode.pl</url>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:stawirej/threads-collider.git</connection>
    <developerConnection>scm:git:git@github.com:stawirej/threads-collider.git</developerConnection>
    <url>https://github.com/stawirej/threads-collider</url>
  </scm>

  <issueManagement>
    <system>GitHub Issues</system>
    <url>https://github.com/stawirej/threads-collider/issues</url>
  </issueManagement>

  <distributionManagement>
    <repository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
    </repository>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <spotless.version>2.40.0</spotless.version>
    <maven.surefire.plugin.version>3.1.2</maven.surefire.plugin.version>
    <maven.compiler.plugin.version>3.11.0</maven.compiler.plugin.version>
    <maven.jar.plugin.version>3.3.0</maven.jar.plugin.version>
    <maven.source.plugin.version>3.3.0</maven.source.plugin.version>
    <maven.javadoc.plugin.version>3.6.0</maven.javadoc.plugin.version>
    <maven.gpg.plugin.version>3.1.0</maven.gpg.plugin.version>
    <assertj.core.version>3.24.2</assertj.core.version>
    <junit.version>5.10.0</junit.version>
    <archunit.version>1.1.0</archunit.version>
    <java.version>1.8</java.version>
  </properties>

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

    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>${assertj.core.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <version>${junit.version}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>com.tngtech.archunit</groupId>
      <artifactId>archunit-junit5</artifactId>
      <version>${archunit.version}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <plugins>
      <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-jar-plugin</artifactId>
        <version>${maven.jar.plugin.version}</version>
        <configuration>
          <archive>
            <manifestEntries>
              <Automatic-Module-Name>${project.groupId}.threads.collider</Automatic-Module-Name>
            </manifestEntries>
          </archive>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${maven.surefire.plugin.version}</version>
        <configuration>
          <useFile>false</useFile>
          <systemProperties>
            <property>
              <name>generateReport</name>
              <value>html</value>
            </property>
          </systemProperties>
          <includes>
            <include>**/*Scenarios.java</include>
          </includes>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-source-plugin</artifactId>
        <version>${maven.source.plugin.version}</version>
        <executions>
          <execution>
            <id>attach-source</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
            <phase>compile</phase>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${maven.javadoc.plugin.version}</version>
        <configuration>
          <source>${java.version}</source>
        </configuration>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </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>
            <goals>
              <goal>sign</goal>
            </goals>
            <phase>verify</phase>
            <configuration>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
          </execution>
        </executions>
      </plugin>

      <plugin>
        <groupId>com.diffplug.spotless</groupId>
        <artifactId>spotless-maven-plugin</artifactId>
        <version>${spotless.version}</version>
        <configuration>
          <java>
            <indent>
              <spaces>true</spaces>
              <spacesPerTab>2</spacesPerTab>
            </indent>
            <toggleOffOn>
              <off>@formatter:off</off>
              <on>@formatter:on</on>
            </toggleOffOn>
            <googleJavaFormat>
              <version>1.18.1</version>
            </googleJavaFormat>
            <removeUnusedImports></removeUnusedImports>
          </java>
          <pom>
            <includes>
              <include>pom.xml</include>
            </includes>
            <sortPom></sortPom>
          </pom>
        </configuration>
        <executions>
          <!-- Runs in compile phase to fail fast in case of formatting issues. -->
          <execution>
            <id>spotless-check</id>
            <goals>
              <goal>check</goal>
            </goals>
            <phase>compile</phase>
          </execution>
        </executions>
      </plugin>

    </plugins>
  </build>

</project>
