<?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>xyz.brandonfl</groupId>
  <artifactId>throwable-optional</artifactId>
  <version>1.0.2</version>

  <name>Throwable Optional</name>
  <description>Java utility class that enables the possibility to use the Optional with functions that can throw exceptions</description>
  <url>https://github.com/brandonfl/throwable-optional</url>

  <licenses>
    <license>
      <name>MIT License</name>
      <url>https://github.com/brandonfl/throwable-optional/blob/master/LICENSE</url>
    </license>
  </licenses>

  <developers>
    <developer>
      <name>Brandon Fontany-Legall</name>
      <email>brandon@fontany-legall.xyz</email>
      <organization>BrandonFL</organization>
      <organizationUrl>https://brandonfl.xyz/</organizationUrl>
    </developer>
  </developers>

  <scm>
    <connection>scm:git:git://github.com/brandonfl/throwable-optional.git</connection>
    <developerConnection>scm:git:ssh://github.com:brandonfl/throwable-optional.git</developerConnection>
    <url>http://github.com/brandonfl/throwable-optional/tree/master</url>
  </scm>

  <properties>
    <maven.compiler.source>11</maven.compiler.source>
    <maven.compiler.target>11</maven.compiler.target>

    <sonar.projectKey>brandonfl_throwable-optional</sonar.projectKey>
    <sonar.organization>fontanylegall-brandon</sonar.organization>
    <sonar.host.url>https://sonarcloud.io</sonar.host.url>
  </properties>

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

    </plugins>
  </build>

  <profiles>
    <profile>
      <id>release-ossrh</id>
      <activation>
        <property>
          <name>releaseFor</name>
          <value>ossrh</value>
        </property>
      </activation>
      <distributionManagement>
        <repository>
          <id>ossrh</id>
          <name>Central Repository OSSRH</name>
          <url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</url>
        </repository>
      </distributionManagement>
      <build>
        <plugins>
          <plugin>
            <groupId>org.sonatype.plugins</groupId>
            <artifactId>nexus-staging-maven-plugin</artifactId>
            <version>1.6.7</version>
            <extensions>true</extensions>
            <configuration>
              <serverId>ossrh</serverId>
              <nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
              <autoReleaseAfterClose>true</autoReleaseAfterClose>
            </configuration>
          </plugin>
          <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-gpg-plugin</artifactId>
            <version>1.6</version>
            <configuration>
              <gpgArguments>
                <arg>--pinentry-mode</arg>
                <arg>loopback</arg>
              </gpgArguments>
            </configuration>
            <executions>
              <execution>
                <id>sign-artifacts</id>
                <phase>verify</phase>
                <goals>
                  <goal>sign</goal>
                </goals>
              </execution>
            </executions>
          </plugin>
        </plugins>
      </build>
    </profile>

    <profile>
      <id>release-github</id>
      <activation>
        <property>
          <name>releaseFor</name>
          <value>github</value>
        </property>
      </activation>
      <distributionManagement>
        <repository>
          <id>github</id>
          <name>GitHub brandonfl Apache Maven Packages</name>
          <url>https://maven.pkg.github.com/brandonfl/throwable-optional</url>
        </repository>
      </distributionManagement>
    </profile>
  </profiles>

  <dependencies>
    <dependency>
      <groupId>org.junit.jupiter</groupId>
      <artifactId>junit-jupiter-engine</artifactId>
      <version>5.1.0</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>RELEASE</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>
