<?xml version="1.0" encoding="UTF-8"?>
<!--
MIT License

Copyright (c) 2021-2023 Kirill Che. <g4s8.public@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights * to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
-->
<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>wtf.g4s8</groupId>
  <artifactId>rio</artifactId>
  <version>1.0.0</version>
  <name>RIO</name>
  <description>Reactive IO components</description>
  <url>https://github.com/g4s8/rio</url>
  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://github.com/g4s8/rio/blob/master/LICENSE.txt</url>
    </license>
  </licenses>
  <developers>
    <developer>
      <id>g4s8</id>
      <name>Kirill Che.</name>
      <email>g4s8.public@gmail.com</email>
      <url>https://g4s8.wtf</url>
      <roles>
        <role>architect</role>
        <role>developer</role>
      </roles>
    </developer>
  </developers>
  <scm>
    <connection>scm:git:git://github.com/g4s8/rio.git</connection>
    <developerConnection>scm:git:ssh://github.com:g4s8/rio.git</developerConnection>
    <url>https://github.com/g4s8/rio/tree/master</url>
  </scm>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/g4s8/rio/issues</url>
  </issueManagement>
  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <versions.reactive-streams>1.0.4</versions.reactive-streams>
    <surefire.version>3.0.0-M7</surefire.version>
    <junit-platform.version>5.8.2</junit-platform.version>
  </properties>
  <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>
  <dependencies>
    <dependency>
      <groupId>org.reactivestreams</groupId>
      <artifactId>reactive-streams</artifactId>
      <version>${versions.reactive-streams}</version>
    </dependency>
    <dependency>
      <groupId>org.jctools</groupId>
      <artifactId>jctools-core</artifactId>
      <version>4.0.1</version>
    </dependency>
    <dependency>
      <groupId>org.reactivestreams</groupId>
      <artifactId>reactive-streams-tck</artifactId>
      <version>${versions.reactive-streams}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>io.reactivex.rxjava2</groupId>
      <artifactId>rxjava</artifactId>
      <version>2.2.21</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.testng</groupId>
      <artifactId>testng</artifactId>
      <version>7.4.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>${junit-platform.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-api</artifactId>
      <version>${junit-platform.version}</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>org.hamcrest</groupId>
      <artifactId>hamcrest</artifactId>
      <scope>test</scope>
      <version>2.2</version>
    </dependency>
  </dependencies>
  <build>
    <testResources>
      <testResource>
        <directory>${basedir}/src/test/resources</directory>
        <filtering>false</filtering>
      </testResource>
      <testResource>
        <directory>${basedir}/src/test/resources-binary</directory>
        <filtering>false</filtering>
      </testResource>
    </testResources>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-enforcer-plugin</artifactId>
        <version>3.1.0</version>
        <executions>
          <execution>
            <id>enforce-maven</id>
            <goals>
              <goal>enforce</goal>
            </goals>
            <configuration>
              <rules>
                <requireMavenVersion>
                  <version>[3.3.0,)</version>
                </requireMavenVersion>
              </rules>
            </configuration>
          </execution>
        </executions>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>${surefire.version}</version>
        <dependencies>
          <dependency>
            <groupId>org.junit.jupiter</groupId>
            <artifactId>junit-jupiter-engine</artifactId>
            <version>5.9.2</version>
          </dependency>
        </dependencies>
        <executions>
          <execution>
            <id>surefire-testng</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>false</skip>
              <includes>
                <include>wtf.g4s8.channel.ReadFlowTest</include>
                <include>wtf.g4s8.channel.WriteSubscriberTestReadFlowTest</include>
              </includes>
              <junitArtifactName>none:none</junitArtifactName>
              <failIfNoTests>false</failIfNoTests>
              <failIfNoSpecifiedTests>false</failIfNoSpecifiedTests>
            </configuration>
          </execution>
          <execution>
            <id>surefire-junit</id>
            <phase>test</phase>
            <goals>
              <goal>test</goal>
            </goals>
            <configuration>
              <skip>false</skip>
              <excludes>
                <exclude>wtf.g4s8.channel.ReadFlowTest</exclude>
                <exclude>wtf.g4s8.channel.WriteSubscriberTestReadFlowTest</exclude>
              </excludes>
              <testNGArtifactName>none:none</testNGArtifactName>
            </configuration>
          </execution>
        </executions>
      </plugin>
    </plugins>
    <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.2.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.10.1</version>
          <configuration>
            <optimize>true</optimize>
            <showWarnings>true</showWarnings>
            <showDeprecation>true</showDeprecation>
            <source>${maven.compiler.source}</source>
            <target>${maven.compiler.target}</target>
            <useIncrementalCompilation>false</useIncrementalCompilation>
            <compilerArgs>
              <arg>-Xlint</arg>
              <arg>-Werror</arg>
              <arg>-Xlint:-path</arg>
              <!-- @see https://stackoverflow.com/questions/44675503/why-safevarargs-doesnt-suppress-the-warning -->
              <arg>-Xlint:-varargs</arg>
              <!-- @see https://blogs.oracle.com/darcy/entry/bootclasspath_older_source -->
              <arg>-Xlint:-options</arg>
              <!-- ignore APT warnings -->
              <arg>-Xlint:-processing</arg>
            </compilerArgs>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.0.0-M7</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.12.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>3.4.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.4.1</version>
        </plugin>
      </plugins>
      <!--
          <pluginManagement>
      <plugins>
        <plugin>
          <artifactId>maven-clean-plugin</artifactId>
          <version>3.2.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-resources-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-compiler-plugin</artifactId>
          <version>3.10.1</version>
          <configuration>
            <optimize>true</optimize>
            <showWarnings>true</showWarnings>
            <showDeprecation>true</showDeprecation>
            <source>${maven.compiler.source}</source>
            <target>${maven.compiler.target}</target>
            <useIncrementalCompilation>false</useIncrementalCompilation>
            <compilerArgs>
              <arg>-Xlint</arg>
              <arg>-Werror</arg>
              <arg>-Xlint:-path</arg>
              <arg>-Xlint:-varargs</arg>
              <arg>-Xlint:-options</arg>
              <arg>-Xlint:-processing</arg>
            </compilerArgs>
          </configuration>
        </plugin>
        <plugin>
          <artifactId>maven-surefire-plugin</artifactId>
          <version>3.0.0-M7</version>
        </plugin>
        <plugin>
          <artifactId>maven-jar-plugin</artifactId>
          <version>3.3.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-install-plugin</artifactId>
          <version>3.1.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-deploy-plugin</artifactId>
          <version>3.0.0</version>
        </plugin>
        <plugin>
          <artifactId>maven-site-plugin</artifactId>
          <version>3.12.1</version>
        </plugin>
        <plugin>
          <artifactId>maven-project-info-reports-plugin</artifactId>
          <version>3.4.1</version>
        </plugin>
        <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-javadoc-plugin</artifactId>
          <version>3.4.1</version>
        </plugin>
      </plugins>
    </pluginManagement>
      -->
    </pluginManagement>
  </build>
  <profiles>
    <profile>
      <id>sonatype</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>
            <executions>
              <execution>
                <id>jar-sources</id>
                <configuration>
                  <forceCreation>true</forceCreation>
                </configuration>
                <goals>
                  <goal>jar</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
          <plugin>
            <artifactId>maven-javadoc-plugin</artifactId>
            <executions>
              <execution>
                <id>jar-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.13</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>oss.sonatype.org</serverId>
              <nexusUrl>https://oss.sonatype.org/</nexusUrl>
              <description>${project.version}</description>
              <stagingProgressTimeoutMinutes>10</stagingProgressTimeoutMinutes>
            </configuration>
            <executions>
              <execution>
                <id>deploy-sonatype</id>
                <phase>deploy</phase>
                <goals>
                  <goal>deploy</goal>
                  <goal>release</goal>
                </goals>
                <configuration>
                  <argLine>--add-opens java.base/java.util=ALL-UNNAMED</argLine>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
    <profile>
      <id>gpg-sign</id>
      <activation>
        <property>
          <name>gpg.keyname</name>
        </property>
      </activation>
      <build>
        <plugins>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>3.0.1</version>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
                <configuration>
                  <gpgArguments>
                    <arg>--pinentry-mode</arg>
                    <arg>loopback</arg>
                  </gpgArguments>
                </configuration>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>
  </profiles>
</project>
