<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.ferstl</groupId>
  <artifactId>parallel-stream-support</artifactId>
  <version>2.0.0</version>

  <name>Parallel Stream Support</name>
  <url>https://github.com/ferstl/parallel-stream-support</url>
  <description>
    Parallel streams in Java with a custom ForkJoinPool.
  </description>

  <licenses>
    <license>
      <name>MIT</name>
      <url>http://opensource.org/licenses/MIT</url>
      <distribution>repo</distribution>
    </license>
  </licenses>

  <issueManagement>
    <system>Github</system>
    <url>https://github.com/ferstl/parallel-stream-support/issues</url>
  </issueManagement>

  <ciManagement>
    <system>Travis CI</system>
    <url>https://travis-ci.org/ferstl/parallel-stream-support</url>
  </ciManagement>

  <developers>
    <developer>
      <id>ferstl</id>
      <name>Stefan Ferstl</name>
      <email>st.ferstl@gmail.com</email>
      <url>https://github.com/ferstl</url>
      <timezone>+1</timezone>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:https://github.com/ferstl/parallel-stream-support.git</connection>
    <developerConnection>scm:git:git@github.com:ferstl/parallel-stream-support.git</developerConnection>
    <url>${project.url}</url>
    <tag>parallel-stream-support-2.0.0</tag>
  </scm>

  <distributionManagement>
    <repository>
      <id>${distribution.release.id}</id>
      <url>${distribution.release.url}</url>
    </repository>
    <snapshotRepository>
      <id>${distribution.snapshot.id}</id>
      <url>${distribution.snapshot.url}</url>
    </snapshotRepository>
  </distributionManagement>

  <properties>
    <!-- Plugin versions. -->
    <license-maven-plugin.version>2.11</license-maven-plugin.version>
    <maven-clean-plugin.version>2.6.1</maven-clean-plugin.version>
    <maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
    <maven-deploy-plugin.version>2.8.2</maven-deploy-plugin.version>
    <maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
    <maven-install-plugin.version>2.5.2</maven-install-plugin.version>
    <maven-jar-plugin.version>3.1.2</maven-jar-plugin.version>
    <maven-javadoc-plugin.version>3.1.1</maven-javadoc-plugin.version>
    <maven-project-info-reports-plugin.version>3.0.0</maven-project-info-reports-plugin.version>
    <maven-release-plugin.version>2.5.3</maven-release-plugin.version>
    <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version>
    <maven-source-plugin.version>3.1.0</maven-source-plugin.version>
    <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
    <coveralls-maven-plugin.version>4.3.0</coveralls-maven-plugin.version>
    <jacoco-mavan-plugin.version>0.8.4</jacoco-mavan-plugin.version>

    <!-- Other settings. -->
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <src.zip.location>${java.home}/lib/src.zip</src.zip.location>
    <maven.version>3.3.9</maven.version>
  </properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.junit</groupId>
        <artifactId>junit-bom</artifactId>
        <version>5.5.1</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>java-hamcrest</artifactId>
      <version>2.0.0.0</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
      <version>3.0.0</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <pluginManagement>
      <plugins>
        <plugin>
          <groupId>com.mycila</groupId>
          <artifactId>license-maven-plugin</artifactId>
          <version>${license-maven-plugin.version}</version>
          <configuration>
            <header>${basedir}/LICENSE</header>
            <strictCheck>true</strictCheck>
            <mapping>
              <java>SLASHSTAR_STYLE</java>
            </mapping>
            <includes>
              <include>src/main/**</include>
              <include>src/test/java/**</include>
            </includes>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-clean-plugin</artifactId>
          <version>${maven-clean-plugin.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>${maven-compiler-plugin.version}</version>
          <configuration>
            <release>9</release>
          </configuration>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>${maven-deploy-plugin.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-gpg-plugin</artifactId>
          <version>${maven-gpg-plugin.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-install-plugin</artifactId>
          <version>${maven-install-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-javadoc-plugin</artifactId>
          <version>${maven-javadoc-plugin.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-release-plugin</artifactId>
          <version>${maven-release-plugin.version}</version>
          <configuration>
            <mavenExecutorId>forked-path</mavenExecutorId>
            <useReleaseProfile>false</useReleaseProfile>
            <arguments>-Pdeploy-to-sonatype-oss,generate-javadoc</arguments>
          </configuration>
        </plugin>

        <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-source-plugin</artifactId>
          <version>${maven-source-plugin.version}</version>
        </plugin>

        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>${maven-surefire-plugin.version}</version>
        </plugin>

        <plugin>
          <groupId>org.eluder.coveralls</groupId>
          <artifactId>coveralls-maven-plugin</artifactId>
          <version>${coveralls-maven-plugin.version}</version>
        </plugin>

        <plugin>
          <groupId>org.jacoco</groupId>
          <artifactId>jacoco-maven-plugin</artifactId>
          <version>${jacoco-mavan-plugin.version}</version>
        </plugin>
      </plugins>
    </pluginManagement>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <executions>
          <execution>
            <id>attach-sources</id>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>generate-javadoc</id>
      <activation>
        <activeByDefault>false</activeByDefault>
      </activation>
      <dependencies>
        <!-- Needed for Javadoc -->
        <dependency>
          <groupId>com.oracle</groupId>
          <artifactId>java</artifactId>
          <version>1.8</version>
          <scope>system</scope>
          <classifier>sources</classifier>
          <type>zip</type>
          <systemPath>${src.zip.location}</systemPath>
        </dependency>
      </dependencies>
      <build>
        <plugins>
          <!-- Unpack the JDK src.zip -->
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <executions>
              <execution>
                <id>unpack-java-src</id>
                <phase>prepare-package</phase>
                <goals>
                  <goal>unpack-dependencies</goal>
                </goals>
                <configuration>
                  <includeScope>system</includeScope>
                  <includes>**/java/util/**/*.java</includes>
                </configuration>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <configuration>
              <subpackages>com.github.ferstl</subpackages>
              <sourcepath>${project.build.sourceDirectory};${project.build.directory}/dependency</sourcepath>
              <links>
                <link>https://docs.oracle.com/en/java/javase/11/docs/api/</link>
              </links>
              <tags>
                <tag>
                  <name>apiNote</name>
                  <placement>a</placement>
                  <head>API Note:</head>
                </tag>
                <tag>
                  <name>implSpec</name>
                  <placement>a</placement>
                  <head>Implementation Requirements:</head>
                </tag>
                <tag>
                  <name>implNote</name>
                  <placement>a</placement>
                  <head>Implementation Note:</head>
                </tag>
              </tags>
            </configuration>
            <executions>
              <execution>
                <id>attach-javadocs</id>
                <phase>package</phase>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>deploy-to-sonatype-oss</id>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
