<?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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.github.chrisvest</groupId>
  <artifactId>stormpot</artifactId>
  <version>3.0.1</version>
  <packaging>jar</packaging>
  <name>stormpot</name>
  <description>A fast object pool library.</description>
  <url>http://chrisvest.github.io/stormpot</url>
  <inceptionYear>2011-2019</inceptionYear>

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

  <scm>
    <url>https://github.com/chrisvest/stormpot</url>
    <connection>scm:git:git://github.com/chrisvest/stormpot.git</connection>
    <developerConnection>scm:git:git@github.com:chrisvest/stormpot.git</developerConnection>
  </scm>

  <developers>
    <developer>
      <id>chrisvest</id>
      <name>Chris Vest</name>
      <email>mr.chrisvest@gmail.com</email>
      <roles>
        <role>Programmer</role>
      </roles>
      <timezone>+1</timezone>
    </developer>
  </developers>

  <properties>
    <outputEncoding>UTF-8</outputEncoding>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <java.version>11</java.version>
    <jacoco.version>0.8.2</jacoco.version>
    <javadoc.version>3.0.1</javadoc.version>
    <asciidoclet.version>2.0.0</asciidoclet.version>
  </properties>

  <distributionManagement>
    <snapshotRepository>
      <id>ossrh</id>
      <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </snapshotRepository>
  </distributionManagement>

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.0.0-M2</version>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>3.3.9</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
        <version>3.0.0</version>
        <configuration>
          <configLocation>src/etc/checkstyle.xml</configLocation>
          <excludes>**/module-info.java</excludes>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.8.0</version>
        <configuration>
          <compilerVersion>${java.version}</compilerVersion>
          <source>${java.version}</source>
          <target>${java.version}</target>
          <compilerArgument>-Xlint:all</compilerArgument>
          <showWarnings>true</showWarnings>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>3.0.0-M1</version>
        <configuration>
          <trimStackTrace>false</trimStackTrace>
          <argLine>
            @{argLine}
            --add-opens stormpot/stormpot=ALL-UNNAMED
            --add-opens stormpot/blackbox=ALL-UNNAMED
            --add-opens stormpot/extensions=ALL-UNNAMED
            -Djunit.jupiter.execution.parallel.enabled=true
            -Djunit.jupiter.execution.parallel.mode.classes.default=concurrent
            -Djunit.jupiter.execution.timeout.default=30m
          </argLine>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-failsafe-plugin</artifactId>
        <version>3.0.0-M1</version>
        <configuration>
          <trimStackTrace>false</trimStackTrace>
          <argLine>
            @{argLine}
            --add-opens stormpot/stormpot=ALL-UNNAMED
            --add-opens stormpot/blackbox=ALL-UNNAMED
            --add-opens stormpot/extensions=ALL-UNNAMED
            -Djunit.jupiter.execution.parallel.enabled=true
            -Djunit.jupiter.execution.parallel.mode.classes.default=concurrent
            -Djunit.jupiter.execution.timeout.default=30m
          </argLine>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>integration-test</goal>
              <goal>verify</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco.version}</version>
        <executions>
          <execution>
            <goals>
              <goal>prepare-agent</goal>
            </goals>
          </execution>
          <execution>
            <id>report</id>
            <phase>test</phase>
            <goals>
              <goal>report</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>3.7.1</version>
      </plugin>
      <plugin>
        <!--
          Run mutation tests like this:
          mvn clean install org.pitest:pitest-maven:mutationCoverage
        -->
        <groupId>org.pitest</groupId>
        <artifactId>pitest-maven</artifactId>
        <version>1.4.3</version>
        <configuration>
          <targetTests>
            <param>stormpot.*</param>
          </targetTests>
          <targetClasses>
            <param>stormpot.*</param>
          </targetClasses>
          <threads>4</threads>
          <jvmArgs>
            <value>-ea</value>
          </jvmArgs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>com.mycila</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>3.0</version>
        <configuration>
          <header>com/mycila/maven/plugin/license/templates/APACHE-2.txt</header>
          <properties>
            <owner>Chris Vest</owner>
            <year>${project.inceptionYear}</year>
            <email>mr.chrisvest@gmail.com</email>
          </properties>
          <mapping>
            <java>SLASHSTAR_STYLE</java>
          </mapping>
          <includes>
            <include>**/*.java</include>
          </includes>
        </configuration>
        <executions>
          <execution>
            <phase>compile</phase>
            <goals>
              <goal>check</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${javadoc.version}</version>
        <executions>
          <execution>
            <id>attach-javadocs</id>
            <goals>
              <goal>jar</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <additionalJOptions>
            <additionalJOption>-J--add-exports=jdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED</additionalJOption>
            <additionalJOption>-Xdoclint:all,-html,-accessibility</additionalJOption>
            <additionalJOption>--base-dir</additionalJOption>
            <additionalJOption>${project.basedir}</additionalJOption>
          </additionalJOptions>
          <doclet>org.asciidoctor.asciidoclet.Asciidoclet</doclet>
          <detectJavaApiLink>true</detectJavaApiLink>
          <docletPath>${project.basedir}/build/asciidoclet-2.0.0-shaded.jar</docletPath>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.asciidoctor</groupId>
        <artifactId>asciidoctor-maven-plugin</artifactId>
        <version>1.6.0</version>
        <executions>
          <execution>
            <id>output-html</id>
            <phase>pre-site</phase>
            <goals>
              <goal>process-asciidoc</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <sourceDirectory>docs</sourceDirectory>
          <outputDirectory>target/docs</outputDirectory>
          <backend>html</backend>
          <sourceHighlighter>coderay</sourceHighlighter>
          <requires>
            <require>asciidoctor-diagram</require>
          </requires>
        </configuration>
        <dependencies>
          <dependency>
            <groupId>org.asciidoctor</groupId>
            <artifactId>asciidoctorj-diagram</artifactId>
            <version>1.5.18</version>
          </dependency>
        </dependencies>
      </plugin>
      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
        <version>1.6.8</version>
        <extensions>true</extensions>
        <configuration>
          <serverId>ossrh</serverId>
          <nexusUrl>https://oss.sonatype.org/</nexusUrl>
          <autoReleaseAfterClose>true</autoReleaseAfterClose>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>3.2.0</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release</id>
      <activation>
        <property>
          <name>performRelease</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <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>

  <dependencies>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>5.5.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-params</artifactId>
      <version>5.5.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.assertj</groupId>
      <artifactId>assertj-core</artifactId>
      <version>3.12.2</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.dropwizard.metrics5</groupId>
      <artifactId>metrics-core</artifactId>
      <version>5.0.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hdrhistogram</groupId>
      <artifactId>HdrHistogram</artifactId>
      <version>2.1.10</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <reporting>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
        <version>3.0.0</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <version>${javadoc.version}</version>
        <configuration>
          <additionalJOptions>
            <additionalJOption>-J--add-exports=jdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED</additionalJOption>
            <additionalJOption>-Xdoclint:all,-html,-accessibility</additionalJOption>
            <additionalJOption>--base-dir</additionalJOption>
            <additionalJOption>${project.basedir}</additionalJOption>
          </additionalJOptions>
          <doclet>org.asciidoctor.asciidoclet.Asciidoclet</doclet>
          <detectJavaApiLink>true</detectJavaApiLink>
          <docletPath>${project.basedir}/build/asciidoclet-2.0.0-shaded.jar</docletPath>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jxr-plugin</artifactId>
        <version>3.0.0</version>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-pmd-plugin</artifactId>
        <version>3.11.0</version>
        <configuration>
          <linkXRef>true</linkXRef>
          <sourceEncoding>utf-8</sourceEncoding>
          <targetJdk>${java.version}</targetJdk>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.jacoco</groupId>
        <artifactId>jacoco-maven-plugin</artifactId>
        <version>${jacoco.version}</version>
      </plugin>
      <plugin>
        <groupId>com.github.spotbugs</groupId>
        <artifactId>spotbugs-maven-plugin</artifactId>
        <version>3.1.9</version>
        <configuration>
          <xmlOutput>true</xmlOutput>
        </configuration>
      </plugin>
    </plugins>
  </reporting>
</project>
