<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2020 Rob Spoor

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<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>

  <parent>
    <groupId>com.github.robtimus</groupId>
    <artifactId>robtimus-parent</artifactId>
    <version>1.4.3</version>
    <relativePath />
  </parent>

  <artifactId>junit-support</artifactId>
  <version>2.0</version>
  <packaging>jar</packaging>

  <name>junit-support</name>
  <description>Contains interfaces and classes that make it easier to write tests with JUnit</description>
  <url>https://robtimus.github.io/junit-support/</url>
  <inceptionYear>2020</inceptionYear>

  <licenses>
    <license>
      <name>The Apache Software License, Version 2.0</name>
      <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Rob Spoor</name>
      <email>robtimus@users.noreply.github.com</email>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git@github.com:robtimus/junit-support.git</connection>
    <developerConnection>scm:git:git@github.com:robtimus/junit-support.git</developerConnection>
    <tag>2.0</tag>
    <url>https://github.com/robtimus/junit-support</url>
  </scm>

  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/robtimus/junit-support/issues</url>
  </issueManagement>

  <properties>
    <version.commons-io>2.11.0</version.commons-io>
    <version.io-functions>2.0</version.io-functions>
    <version.junit-testkit>1.9.0</version.junit-testkit>
    <version.pioneer>1.7.1</version.pioneer>
  </properties>

  <dependencies>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter</artifactId>
    </dependency>

    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
    </dependency>

    <dependency>
      <groupId>org.mockito</groupId>
      <artifactId>mockito-core</artifactId>
    </dependency>

    <dependency>
      <groupId>com.github.robtimus</groupId>
      <artifactId>io-functions</artifactId>
      <version>${version.io-functions}</version>
    </dependency>

    <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>${version.commons-io}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit.platform</groupId>
      <artifactId>junit-platform-testkit</artifactId>
      <version>${version.junit-testkit}</version>
      <scope>test</scope>
    </dependency>

    <dependency>
      <groupId>org.junit-pioneer</groupId>
      <artifactId>junit-pioneer</artifactId>
      <version>${version.pioneer}</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

  <build>
    <resources>
      <!-- add LICENSE.txt to META-INF besides the main resources -->
      <resource>
        <directory>src/main/resources</directory>
      </resource>
      <resource>
        <directory>${project.basedir}</directory>
        <targetPath>META-INF</targetPath>
        <includes>
          <include>LICENSE.txt</include>
        </includes>
      </resource>
    </resources>

    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-jar-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-resources-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-checkstyle-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-javadoc-plugin</artifactId>
        <configuration>
          <links>
            <link>https://commons.apache.org/proper/commons-io/javadocs/api-release/</link>
            <link>https://junit.org/junit5/docs/current/api/</link>
          </links>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.moditect</groupId>
        <artifactId>moditect-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-antrun-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
          <descriptors>
            <descriptor>src/main/assembly/src.xml</descriptor>
            <descriptor>src/main/assembly/bin.xml</descriptor>
          </descriptors>
        </configuration>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-clean-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-install-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-release-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-gpg-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.sonatype.plugins</groupId>
        <artifactId>nexus-staging-maven-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
      </plugin>

      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-project-info-reports-plugin</artifactId>
      </plugin>
    </plugins>
  </build>

  <profiles>
    <profile>
      <id>min-versions</id>
      <properties>
        <version.junit>5.9.0</version.junit>
        <version.junit-testkit>1.9.0</version.junit-testkit>
      </properties>
    </profile>

    <profile>
      <id>native-module</id>
      <properties>
        <version.java>11</version.java>
      </properties>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <configuration>
              <!-- Allow JUnit to fully access the test classes -->
              <argLine>
                --add-opens com.github.robtimus.junit.support/com.github.robtimus.junit.support=org.junit.platform.commons
                --add-opens com.github.robtimus.junit.support/com.github.robtimus.junit.support.extension=org.junit.platform.commons
                --add-opens com.github.robtimus.junit.support/com.github.robtimus.junit.support.extension.testresource=org.junit.platform.commons
                --add-opens com.github.robtimus.junit.support/com.github.robtimus.junit.support.params=org.junit.platform.commons
                --add-opens com.github.robtimus.junit.support/com.github.robtimus.junit.support.test=org.junit.platform.commons
                --add-opens com.github.robtimus.junit.support/com.github.robtimus.junit.support.test.collections=org.junit.platform.commons
                --add-opens com.github.robtimus.junit.support/com.github.robtimus.junit.support.test.io=org.junit.platform.commons

                --add-opens com.github.robtimus.junit.support/com.github.robtimus.junit.support.examples.collections=org.junit.platform.commons
                --add-opens com.github.robtimus.junit.support/com.github.robtimus.junit.support.examples.covariantreturn=org.junit.platform.commons
                --add-opens com.github.robtimus.junit.support/com.github.robtimus.junit.support.examples.delegation=org.junit.platform.commons
                --add-opens com.github.robtimus.junit.support/com.github.robtimus.junit.support.examples.io=org.junit.platform.commons

                --add-opens org.junit.platform.commons/org.junit.platform.commons.logging=ALL-UNNAMED
                --add-opens org.junit.platform.commons/org.junit.platform.commons.util=ALL-UNNAMED
              </argLine>
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.moditect</groupId>
            <artifactId>moditect-maven-plugin</artifactId>
            <configuration>
              <skip>true</skip>
            </configuration>
          </plugin>

          <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>build-helper-maven-plugin</artifactId>
            <executions>
              <execution>
                <phase>generate-sources</phase>
                <goals>
                  <goal>add-source</goal>
                </goals>
                <configuration>
                  <sources>
                    <source>${project.basedir}/src/moditect</source>
                  </sources>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
